use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class QueryResultsSerializationTest method shouldBeAbleToReturnDeletedRelationshipsRest.
@Test
public void shouldBeAbleToReturnDeletedRelationshipsRest() {
// 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"));
assertThat(commit, containsNoErrors());
assertThat(commit, restContainsDeletedEntities(1));
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 returningADeletedPathGraph.
@Test
public void returningADeletedPathGraph() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonGraph("MATCH p=(s)-[r:R]->(e) DELETE p RETURN p"));
assertThat(commit, containsNoErrors());
assertThat(commit, graphContainsDeletedNodes(2));
assertThat(commit, graphContainsDeletedRelationships(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 returningAPartiallyDeletedPathGraph.
@Test
public void returningAPartiallyDeletedPathGraph() {
// given
graphdb().execute("CREATE (:Start)-[:R]->(:End)");
// execute and commit
Response commit = http.POST(commitResource, queryAsJsonGraph("MATCH p=(s)-[r:R]->(e) DELETE s,r RETURN p"));
assertThat(commit, containsNoErrors());
assertThat(commit, graphContainsDeletedNodes(1));
assertThat(commit, graphContainsDeletedRelationships(1));
assertThat(commit.status(), equalTo(200));
assertThat(nodesInDatabase(), equalTo(1L));
}
use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class TransactionTerminationIT method startTx.
private static Response startTx(HTTP.Builder http) {
Response tx = http.POST("db/data/transaction");
assertThat(tx.status(), equalTo(201));
assertThat(tx, containsNoErrors());
return tx;
}
use of org.neo4j.test.server.HTTP.Response in project neo4j by neo4j.
the class TransactionIT method status_codes_should_appear_in_response.
@Test
public void status_codes_should_appear_in_response() throws Exception {
Response response = http.POST("/db/data/transaction/commit", quotedJson("{ 'statements': [ { 'statement': 'RETURN {n}' } ] }"));
assertThat(response.status(), equalTo(200));
assertThat(response, hasErrors(Status.Statement.ParameterMissing));
}
Aggregations