use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method shouldBeAbleToReturnDeletedEntitiesRest.
@Test
public void shouldBeAbleToReturnDeletedEntitiesRest() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRest("MATCH (s:Start)-[r:R]->(e:End) DELETE s, r, e RETURN *"));
assertThat(commit, containsNoErrors());
assertThat(commit, restContainsDeletedEntities(3));
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 returningADeletedPathRest.
@Test
public void returningADeletedPathRest() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRest("MATCH p=(s)-[r:R]->(e) DELETE p RETURN p"));
assertThat(commit, containsNoErrors());
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 shouldFailIfTryingToReturnPropsOfDeletedNodeRest.
@Test
public void shouldFailIfTryingToReturnPropsOfDeletedNodeRest() {
// given
graphdb().execute("CREATE (:NodeToDelete {p: 'a property'})");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRest("MATCH (n:NodeToDelete) DELETE n RETURN n.p"));
assertThat(commit, hasErrors(Status.Statement.EntityNotFound));
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 shouldBeAbleToReturnDeletedEntitiesRow.
@Test
public void shouldBeAbleToReturnDeletedEntitiesRow() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRow("MATCH (s:Start)-[r:R]->(e:End) DELETE s, r, e RETURN *"));
assertThat(commit, containsNoErrors());
assertThat(commit, rowContainsDeletedEntities(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 shouldFailIfTryingToReturnPropsOfDeletedRelationshipRest.
@Test
public void shouldFailIfTryingToReturnPropsOfDeletedRelationshipRest() {
// given
graphdb().execute("CREATE (:Start)-[:R {p: 'a property'}]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonRest("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));
}
Aggregations