Skip to content

Commit

Permalink
add tag not found test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Apr 1, 2017
1 parent cc52126 commit 4087138
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/com/maxdemarzi/tags/GetTagTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import java.util.ArrayList;
import java.util.HashMap;

import static com.maxdemarzi.Properties.*;

public class GetTagTest {
@Rule
public Neo4jRule neo4j = new Neo4jRule()
Expand Down Expand Up @@ -44,6 +46,19 @@ public void shouldGetTagSince() {
Assert.assertEquals(expected.get(1), actual.get(0));
}

@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));
}
private static final String FIXTURE =
"CREATE (max:User {username:'maxdemarzi', " +
"email: 'max@neo4j.com', " +
Expand Down

0 comments on commit 4087138

Please sign in to comment.