Search in sources :

Example 31 with RestRequest

use of org.neo4j.server.rest.RestRequest in project neo4j by neo4j.

the class PagedTraverserIT method shouldRespondWith200OnFirstDeletionOfTraversalAnd404Afterwards.

@Test
public void shouldRespondWith200OnFirstDeletionOfTraversalAnd404Afterwards() {
    theStartNode = createLinkedList(SHORT_LIST_LENGTH, server.getDatabase());
    JaxRsResponse response = createPagedTraverser();
    final RestRequest request = RestRequest.req();
    JaxRsResponse deleteResponse = request.delete(response.getLocation());
    assertEquals(200, deleteResponse.getStatus());
    deleteResponse = request.delete(response.getLocation());
    assertEquals(404, deleteResponse.getStatus());
}
Also used : RestRequest(org.neo4j.server.rest.RestRequest) JaxRsResponse(org.neo4j.server.rest.JaxRsResponse) Test(org.junit.Test)

Aggregations

RestRequest (org.neo4j.server.rest.RestRequest)31 JaxRsResponse (org.neo4j.server.rest.JaxRsResponse)29 Test (org.junit.Test)26 Matchers.containsString (org.hamcrest.Matchers.containsString)7 URI (java.net.URI)6 Client (com.sun.jersey.api.client.Client)3 Documented (org.neo4j.kernel.impl.annotations.Documented)3 FunctionalTestHelper (org.neo4j.server.helpers.FunctionalTestHelper)3 File (java.io.File)2 FileUtils.readTextFile (org.neo4j.io.fs.FileUtils.readTextFile)2 NeoServer (org.neo4j.server.NeoServer)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ListenSocketAddress (org.neo4j.helpers.ListenSocketAddress)1 CommunityServerBuilder (org.neo4j.server.helpers.CommunityServerBuilder)1 PrettyJSON (org.neo4j.server.rest.PrettyJSON)1 NodeRepresentationTest (org.neo4j.server.rest.repr.NodeRepresentationTest)1 RelationshipRepresentationTest (org.neo4j.server.rest.repr.RelationshipRepresentationTest)1