本文整理汇总了Java中org.neo4j.test.server.HTTP.GET属性的典型用法代码示例。如果您正苦于以下问题:Java HTTP.GET属性的具体用法?Java HTTP.GET怎么用?Java HTTP.GET使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.neo4j.test.server.HTTP
的用法示例。
在下文中一共展示了HTTP.GET属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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));
}
示例2: shouldCreateMention
@Test
public void shouldCreateMention() 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/users/jexp/mentions").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("Hello @jexp", actual2.get(0).get(STATUS));
}
示例3: shouldGetLatest
@Test
public void shouldGetLatest() throws InterruptedException {
HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
sleep(1000);
HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/search/latest").toString());
ArrayList<HashMap> actual = response.content();
Assert.assertEquals(expected, actual);
}
示例4: shouldGetLikesWithUser
@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);
}
示例5: shouldGetLatestLimited
@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: shouldGetFollowingSince
@Test
public void shouldGetFollowingSince() {
HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/maxdemarzi/following?since=1490140300").toString());
ArrayList<HashMap> actual = response.content();
Assert.assertTrue(actual.size() == 1);
Assert.assertEquals(expected.get(1), actual.get(0));
}
示例7: shouldGetSearch
@Test
public void shouldGetSearch() 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").toString());
ArrayList<HashMap> actual = response.content();
Assert.assertEquals(expected, actual);
}
示例8: shouldGetMentionsLimited
@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));
}
示例9: shouldGetFollowers
@Test
public void shouldGetFollowers() {
HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/maxdemarzi/followers").toString());
ArrayList<HashMap> actual = response.content();
Assert.assertEquals(expected, actual);
}
示例10: 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));
}
示例11: shouldRecommendFriends
@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);
}
示例12: shouldGetTimeline
@Test
public void shouldGetTimeline() {
HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/maxdemarzi/timeline").toString());
ArrayList<HashMap> actual = response.content();
Assert.assertEquals(expected, actual);
}
示例13: shouldGetFollowersLimited
@Test
public void shouldGetFollowersLimited() {
HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/maxdemarzi/followers?limit=1").toString());
ArrayList<HashMap> actual = response.content();
Assert.assertTrue(actual.size() == 1);
Assert.assertEquals(expected.get(0), actual.get(0));
}
示例14: shouldGetPostsWithUser
@Test
public void shouldGetPostsWithUser() {
HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
HTTP.Response response = HTTP.GET(neo4j.httpURI().resolve("/v1/users/maxdemarzi/posts?username2=jexp").toString());
ArrayList<HashMap> actual = response.content();
Assert.assertEquals(expected2, actual);
}
示例15: shouldGetPostsLimited
@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));
}