当前位置: 首页>>代码示例>>Java>>正文


Java NeoServer.baseUri方法代码示例

本文整理汇总了Java中org.neo4j.server.NeoServer.baseUri方法的典型用法代码示例。如果您正苦于以下问题:Java NeoServer.baseUri方法的具体用法?Java NeoServer.baseUri怎么用?Java NeoServer.baseUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.neo4j.server.NeoServer的用法示例。


在下文中一共展示了NeoServer.baseUri方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: should401WithBasicChallengeWhenASecurityRuleFails

import org.neo4j.server.NeoServer; //导入方法依赖的package包/类
@Test
public void should401WithBasicChallengeWhenASecurityRuleFails()
        throws Exception
{
    NeoServer server = ServerBuilder.server()
            .withSecurityRules(LockDownSecurityRule.class.getCanonicalName() ).build();
    server.start();

    RestRequest restRequest = new RestRequest(server.baseUri());
    String dummyText = "";
    JaxRsResponse response = restRequest.post("db/data/node/0/traverse/node", dummyText);
    assertTrue(response.getStatus() == 401);
    assertTrue(response.getHeaders().getFirst( "WWW-Authenticate" ).contains("Basic realm=\"WallyWorld\""));
    server.stop();
}
 
开发者ID:neo4j-contrib,项目名称:neo_lock_down,代码行数:16,代码来源:LockDownSecurityRuleFunctionalTest.java

示例2: should401WithBasicChallengeWhenASecurityRuleFailswithBatch

import org.neo4j.server.NeoServer; //导入方法依赖的package包/类
@Test
public void should401WithBasicChallengeWhenASecurityRuleFailswithBatch()
        throws Exception
{
    NeoServer server = ServerBuilder.server()
            .withSecurityRules(LockDownSecurityRule.class.getCanonicalName() ).build();
    server.start();

    RestRequest restRequest = new RestRequest(server.baseUri());
    String dummyText = "[ {\n" +
            "  \"method\" : \"POST\",\n" +
            "  \"to\" : \"/node/0/traverse\",\n" +
            "  \"body\" : {\n" +
            "    \"return_filter\" : {\n" +
            "         \"body\" : \"position.length()<3;\",\n" +
            "         \"language\" : \"javascript\" },\n" +
            "    \"prune_evaluator\" : {\n" +
            "         \"name\" : \"none\",\n" +
            "         \"language\" : \"builtin\" }\n" +
            "  },\n" +
            "  \"id\" : 0 }]";

    JaxRsResponse response = restRequest.post("db/data/batch", dummyText);

    // We don't get a nice 200 with an error on the batch request
    // instead we get a 500 actual exception

    //System.out.println(response.getStatus());
    //System.out.println(response.getEntity().toString());
    //assertTrue(response.getStatus() == 401);
    //assertTrue(response.getHeaders().getFirst( "WWW-Authenticate" ).contains("Basic realm=\"WallyWorld\""));
    assertTrue(response.getStatus() == 500);
    server.stop();
}
 
开发者ID:neo4j-contrib,项目名称:neo_lock_down,代码行数:35,代码来源:LockDownSecurityRuleFunctionalTest.java

示例3: should200WithBasicChallengeWhenASecurityRuleSucceeds

import org.neo4j.server.NeoServer; //导入方法依赖的package包/类
@Test
public void should200WithBasicChallengeWhenASecurityRuleSucceeds()
        throws Exception
{
    NeoServer server = ServerBuilder.server()
            .withSecurityRules(LockDownSecurityRule.class.getCanonicalName() ).build();
    server.start();

    RestRequest restRequest = new RestRequest(server.baseUri());

    JaxRsResponse response = restRequest.get("db/data/node/0");
    assertTrue(response.getStatus() == 200);
    server.stop();
}
 
开发者ID:neo4j-contrib,项目名称:neo_lock_down,代码行数:15,代码来源:LockDownSecurityRuleFunctionalTest.java


注:本文中的org.neo4j.server.NeoServer.baseUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。