use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method returningAPartiallyDeletedPathRest.
@Test
public void returningAPartiallyDeletedPathRest() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRest("MATCH p=(s)-[r:R]->(e) DELETE s,r RETURN p"));
assertThat(commit, containsNoErrors());
assertThat(commit.status(), equalTo(200));
assertThat(nodesInDatabase(), equalTo(1L));
}
use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method shouldBeAbleToReturnDeletedNodesRow.
@Test
public void shouldBeAbleToReturnDeletedNodesRow() {
// given
graphdb().execute("CREATE (:NodeToDelete {p: 'a property'})");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRow("MATCH (n:NodeToDelete) DELETE n RETURN n"));
assertThat(commit, containsNoErrors());
assertThat(commit, rowContainsDeletedEntities(1, 0));
assertThat(commit.status(), equalTo(200));
assertThat(nodesInDatabase(), equalTo(0L));
}
use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method nestedShouldWorkRest.
@Test
public void nestedShouldWorkRest() {
// given
graphdb().execute("CREATE ()");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRest("MATCH (n) DELETE (n) RETURN [n, {someKey: n}]"));
assertThat(commit, containsNoErrors());
assertThat(commit.status(), equalTo(200));
assertThat(commit, restContainsNestedDeleted());
assertThat(nodesInDatabase(), equalTo(0L));
}
use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method shouldNotMarkNormalEntitiesAsDeletedRow.
@Test
public void shouldNotMarkNormalEntitiesAsDeletedRow() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRow("MATCH (s:Start)-[r:R]->(e:End) RETURN *"));
assertThat(commit, containsNoErrors());
assertThat(commit, rowContainsNoDeletedEntities());
assertThat(commit.status(), equalTo(200));
}
use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method shouldBeAbleToReturnDeletedNodesGraph.
@Test
public void shouldBeAbleToReturnDeletedNodesGraph() {
// given
graphdb().execute("CREATE (:NodeToDelete {p: 'a property'})");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonGraph("MATCH (n:NodeToDelete) DELETE n RETURN n"));
assertThat(commit, containsNoErrors());
assertThat(commit, graphContainsDeletedNodes(1));
assertThat(commit.status(), equalTo(200));
assertThat(nodesInDatabase(), equalTo(0L));
}
Aggregations