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


Java HTTP.Response方法代码示例

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


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

示例1: shouldGetTagWithUser

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldGetTagWithUser() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

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

示例2: shouldNotCreatePostMissing

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldNotCreatePostMissing() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users/maxdemarzi/posts").toString(), missingParameterInput);
    HashMap actual  = response.content();
    Assert.assertEquals(400, response.status());
    Assert.assertEquals("Missing status Parameter.", actual.get("error"));
    Assert.assertFalse(actual.containsKey(STATUS));
    Assert.assertFalse(actual.containsKey(TIME));
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:12,代码来源:CreatePostTest.java

示例3: shouldRecommendFollows

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldRecommendFollows() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

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

示例4: shouldRecommendFriends

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldRecommendFriends() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

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

示例5: shouldGetLatestLimited

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldGetLatestLimited() throws InterruptedException {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
    sleep(1000);
    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/search/latest?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,代码行数:10,代码来源:GetLatestTest.java

示例6: shouldGetLikesLimited

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldGetLikesLimited() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/maxdemarzi/likes?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,代码行数:10,代码来源:GetLikesTest.java

示例7: shouldNotCreateUserInvalid

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldNotCreateUserInvalid() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users").toString());
    HashMap actual  = response.content();
    Assert.assertEquals(400, response.status());
    Assert.assertEquals("Invalid Input", 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,代码行数:14,代码来源:CreateUserTest.java

示例8: shouldCreateRepost

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldCreateRepost() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

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

示例9: shouldGetPostsSince

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldGetPostsSince() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

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

示例10: shouldGetMentionsLimited

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldGetMentionsLimited() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/jexp/mentions?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,代码行数:10,代码来源:GetMentionsTest.java

示例11: shouldCreateReply

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@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,代码行数:10,代码来源:CreateReplyTest.java

示例12: testMatcherNotRule

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void testMatcherNotRule() throws Exception {
    HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/db/data/transaction/commit").toString(), QUERY2);
    int count = response.get("results").get(0).get("data").size();
    assertEquals(1, count);
    Map rule2 = mapper.convertValue(response.get("results").get(0).get("data").get(0).get("row").get(0), Map.class);
    assertEquals("(a1&a2) | (a3& !a4)", rule2.get("id"));
}
 
开发者ID:maxdemarzi,项目名称:rule_matcher,代码行数:9,代码来源:MatchUserTest.java

示例13: shouldGetPostsLimited

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldGetPostsLimited() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/maxdemarzi/posts?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,代码行数:10,代码来源:GetPostsTest.java

示例14: shouldGetFollowersSince

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldGetFollowersSince() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

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

示例15: shouldGetLikesWithUser

import org.neo4j.test.server.HTTP; //导入方法依赖的package包/类
@Test
public void shouldGetLikesWithUser() {
    HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());

    HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/jexp/likes?username2=maxdemarzi").toString());
    ArrayList<HashMap> actual  = response.content();
    Assert.assertEquals(expected2, actual);
}
 
开发者ID:maxdemarzi,项目名称:grittier_ext,代码行数:9,代码来源:GetLikesTest.java


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