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


Java HTTP.POST属性代码示例

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


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

示例1: testOrderTasks

@Test
public void testOrderTasks() throws Exception {
    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/db/data/transaction/commit").toString(), QUERY1);
    int count = response.get("results").get(0).get("data").size();
    assertEquals(3, count);
    Map task3 = mapper.convertValue(response.get("results").get(0).get("data").get(0).get("row").get(0), Map.class);
    assertEquals("Provider Two", task3.get("provider"));
    assertEquals("t3", task3.get("id"));
    Map task2 = mapper.convertValue(response.get("results").get(0).get("data").get(1).get("row").get(0), Map.class);
    assertEquals("Provider Two", task3.get("provider"));
    assertEquals("t2", task2.get("id"));
    Map task1 = mapper.convertValue(response.get("results").get(0).get("data").get(2).get("row").get(0), Map.class);
    assertEquals("Provider One", task1.get("provider"));
    assertEquals("t1", task1.get("id"));
    ArrayList<Map<String, Object>> dependencies = ((ArrayList)task1.get("dependencies"));
    assertEquals(2, dependencies.size());
    assertEquals(new ArrayList<String>() {{add("e2");}}, dependencies.get(0).get("missing"));
    assertEquals(new ArrayList<String>() {{add("e4");}}, dependencies.get(1).get("remove"));
}
 
开发者ID:maxdemarzi,项目名称:order_workflow,代码行数:19,代码来源:OrderTest.java

示例2: shouldCreateTag

@Test
public void shouldCreateTag() throws InterruptedException {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users/maxdemarzi/posts").toString(), input);
    HashMap actual  = response.content();
    Assert.assertEquals(expected.get(STATUS), actual.get(STATUS));
    Assert.assertTrue(actual.containsKey(TIME));
    sleep(1000); // Needed due to artifact in testing
    response = HTTP.GET(neo4j.httpURI().resolve("/v1/tags/neo4j").toString());
    ArrayList<HashMap> actual2  = response.content();
    expected2.get(0).put(TIME, actual2.get(0).get(TIME));
    Assert.assertEquals(expected2, actual2);

    Assert.assertEquals("maxdemarzi", actual2.get(0).get(USERNAME));
    Assert.assertEquals("Max De Marzi", actual2.get(0).get(NAME));
    Assert.assertEquals(expected.get(STATUS), actual2.get(0).get(STATUS));
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:18,代码来源:CreateTagTest.java

示例3: shouldNotGetTagNotFound

@Test
public void shouldNotGetTagNotFound() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/tags/notneo4j").toString());
    HashMap actual  = response.content();
    Assert.assertEquals(400, response.status());
    Assert.assertEquals("Tag Not Found.", actual.get("error"));
    Assert.assertFalse(actual.containsKey(USERNAME));
    Assert.assertFalse(actual.containsKey(EMAIL));
    Assert.assertFalse(actual.containsKey(NAME));
    Assert.assertFalse(actual.containsKey(STATUS));
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:13,代码来源:GetTagTest.java

示例4: shouldCreateReply

@Test
public void shouldCreateReply() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users/maxdemarzi/posts/jexp/1490140299/reply").toString(), input);
    HashMap actual  = response.content();
    expected.put("time", actual.get("time"));
    Assert.assertEquals(expected, actual);
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:9,代码来源:CreateReplyTest.java

示例5: shouldUpdatePost

@Test
public void shouldUpdatePost() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.request("PUT", neo4j.httpURI().resolve("/v1/users/maxdemarzi/posts/1490140299").toString(), input);
    HashMap actual  = response.content();
    Assert.assertEquals(expected, actual);
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:8,代码来源:UpdatePostTest.java

示例6: shouldGetTag

@Test
public void shouldGetTag() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/tags/neo4j").toString());
    ArrayList<HashMap> actual  = response.content();
    Assert.assertEquals(expected, actual);
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:8,代码来源:GetTagTest.java

示例7: shouldNotCreateUserEmptyPassword

@Test
public void shouldNotCreateUserEmptyPassword() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users").toString(), emptyPasswordInput);
    HashMap actual  = response.content();
    Assert.assertEquals(400, response.status());
    Assert.assertEquals("Empty password Parameter.", actual.get("error"));
    Assert.assertFalse(actual.containsKey(USERNAME));
    Assert.assertFalse(actual.containsKey(EMAIL));
    Assert.assertFalse(actual.containsKey(NAME));
    Assert.assertFalse(actual.containsKey(PASSWORD));
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:13,代码来源:CreateUserTest.java

示例8: shouldGetProfile

@Test
public void shouldGetProfile() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/maxdemarzi/profile").toString());
    HashMap actual  = response.content();
    Assert.assertEquals(expected, actual);
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:8,代码来源:GetProfileTest.java

示例9: shouldGetTagLimited

@Test
public void shouldGetTagLimited() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/tags/neo4j?limit=1").toString());
    ArrayList<HashMap> actual  = response.content();
    Assert.assertTrue(actual.size() == 1);
    Assert.assertEquals(expected.get(0), actual.get(0));
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:9,代码来源:GetTagTest.java

示例10: shouldGetSearchWithUser

@Test
public void shouldGetSearchWithUser() throws InterruptedException {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
    sleep(1000);
    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/search?q=Hello&username=jexp").toString());
    ArrayList<HashMap> actual  = response.content();
    Assert.assertEquals(expected2, actual);
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:8,代码来源:GetSearchTest.java

示例11: shouldCreateBlocksToo

@Test
public void shouldCreateBlocksToo() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users/maxdemarzi/blocks/markhneedham").toString());
    HashMap actual  = response.content();
    Assert.assertEquals(expected2, actual);
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:8,代码来源:CreateBlocksTest.java

示例12: shouldNotCreateUserMissingUsername

@Test
public void shouldNotCreateUserMissingUsername() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users").toString(), missingUsernameInput);
    HashMap actual  = response.content();
    Assert.assertEquals(400, response.status());
    Assert.assertEquals("Missing username Parameter.", actual.get("error"));
    Assert.assertFalse(actual.containsKey(USERNAME));
    Assert.assertFalse(actual.containsKey(EMAIL));
    Assert.assertFalse(actual.containsKey(NAME));
    Assert.assertFalse(actual.containsKey(PASSWORD));
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:13,代码来源:CreateUserTest.java

示例13: shouldNotCreateBlocksAlreadyBlocking

@Test
public void shouldNotCreateBlocksAlreadyBlocking() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users/jexp/blocks/markhneedham").toString());
    HashMap actual  = response.content();
    Assert.assertEquals(400, response.status());
    Assert.assertEquals("Already blocking User.", actual.get("error"));
    Assert.assertFalse(actual.containsKey(USERNAME));
    Assert.assertFalse(actual.containsKey(NAME));
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:11,代码来源:CreateBlocksTest.java

示例14: shouldNotRemoveBlockUser2NotFound

@Test
public void shouldNotRemoveBlockUser2NotFound() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.request("DELETE", neo4j.httpURI().resolve("/v1/users/maxdemarzi/blocks/pxej").toString(), null);
    HashMap actual  = response.content();
    Assert.assertEquals(400, response.status());
    Assert.assertEquals("User not Found.", actual.get("error"));
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:9,代码来源:RemoveBlocksTest.java

示例15: shouldNotRemoveLikeAuthorNotFound

@Test
public void shouldNotRemoveLikeAuthorNotFound() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.request("DELETE", neo4j.httpURI().resolve("/v1/users/maxdemarzi/likes/pxej/1490140299").toString(), null);
    HashMap actual  = response.content();
    Assert.assertEquals(400, response.status());
    Assert.assertEquals("User not Found.", actual.get("error"));
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:9,代码来源:RemoveLikeTest.java


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