-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e45ee93
commit 3bd4121
Showing
3 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.maxdemarzi.users; | ||
|
||
import com.sun.jersey.api.client.UniformInterfaceException; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.rules.ExpectedException; | ||
import org.neo4j.harness.junit.Neo4jRule; | ||
import org.neo4j.test.server.HTTP; | ||
|
||
public class RemoveFollowsTest { | ||
@Rule | ||
public Neo4jRule neo4j = new Neo4jRule() | ||
.withFixture(FIXTURE) | ||
.withExtension("/v1", Users.class); | ||
|
||
@Rule | ||
public ExpectedException thrown = ExpectedException.none(); | ||
|
||
@Test | ||
public void shouldRemoveFollows() { | ||
HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString()); | ||
thrown.expect(UniformInterfaceException.class); | ||
HTTP.request("DELETE", neo4j.httpURI().resolve("/v1/users/maxdemarzi/follows/jexp").toString(), null); | ||
} | ||
private static final String FIXTURE = | ||
"CREATE (max:User {username:'maxdemarzi', " + | ||
"email: 'max@neo4j.com', " + | ||
"name: 'Max De Marzi'," + | ||
"password: 'swordfish'})" + | ||
"CREATE (jexp:User {username:'jexp', " + | ||
"email: 'michael@neo4j.com', " + | ||
"name: 'Michael Hunger'," + | ||
"password: 'tunafish'})" + | ||
"CREATE (max)-[:FOLLOWS {time:1490140299}]->(jexp)"; | ||
} |