use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method shouldNotMarkNormalEntitiesAsDeletedGraph.
@Test
public void shouldNotMarkNormalEntitiesAsDeletedGraph() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonGraph("MATCH (s:Start)-[r:R]->(e:End) RETURN *"));
assertThat(commit, containsNoErrors());
assertThat(commit, graphContainsNoDeletedEntities());
assertThat(commit.status(), equalTo(200));
}
use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method shouldBeAbleToReturnDeletedEntitiesGraph.
@Test
public void shouldBeAbleToReturnDeletedEntitiesGraph() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonGraph("MATCH (s:Start)-[r:R]->(e:End) DELETE s, r, e RETURN *"));
assertThat(commit, containsNoErrors());
assertThat(commit, graphContainsDeletedRelationships(1));
assertThat(commit, graphContainsDeletedNodes(2));
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 shouldFailIfTryingToReturnPropsOfDeletedRelationshipRow.
@Test
public void shouldFailIfTryingToReturnPropsOfDeletedRelationshipRow() {
// given
graphdb().execute("CREATE (:Start)-[:R {p: 'a property'}]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRow("MATCH (s)-[r:R]->(e) DELETE r RETURN r.p"));
assertThat(commit, hasErrors(Status.Statement.EntityNotFound));
assertThat(commit.status(), equalTo(200));
assertThat(nodesInDatabase(), equalTo(2L));
}
use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method returningADeletedPathRow.
@Test
public void returningADeletedPathRow() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRow("MATCH p=(s)-[r:R]->(e) DELETE p RETURN p"));
assertThat(commit, containsNoErrors());
assertThat(commit, rowContainsDeletedEntitiesInPath(2, 1));
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 shouldFailIfTryingToReturnLabelsOfDeletedNodeRow.
@Test
public void shouldFailIfTryingToReturnLabelsOfDeletedNodeRow() {
// given
graphdb().execute("CREATE (:NodeToDelete)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRow("MATCH (n:NodeToDelete) DELETE n RETURN labels(n)"));
assertThat(commit, hasErrors(Status.Statement.EntityNotFound));
assertThat(commit.status(), equalTo(200));
assertThat(nodesInDatabase(), equalTo(1L));
}
Aggregations