本文整理汇总了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);
}
示例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));
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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));
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}
示例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"));
}
示例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));
}
示例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));
}
示例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);
}