Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* used new RecordingRestOperations constructor

  • Loading branch information...
commit 6f559e13667b4b593da5976202a1bfada91fe58d 1 parent 2282c52
@KBurchardi KBurchardi authored
Showing with 13 additions and 17 deletions.
  1. +13 −17 src/test/java/org/neo4j/rest/graphdb/RecordingRestRequestTest.java
View
30 src/test/java/org/neo4j/rest/graphdb/RecordingRestRequestTest.java
@@ -11,22 +11,18 @@
private ExecutingRestRequest exeRequest;
private RecordingRestRequest recRequest;
- private URI baseUri;
+ private String baseUri;
@Before
- public void init(){
- try {
- this.baseUri = new URI("www.test.net");
+ public void init(){
+ this.baseUri = "www.test.net";
this.exeRequest = new ExecutingRestRequest(baseUri);
- this.recRequest = new RecordingRestRequest(exeRequest);
- } catch (URISyntaxException e) {
-
- }
+ this.recRequest = new RecordingRestRequest(exeRequest, new RestOperations());
}
@Test
public void testCreate() {
- RecordingRestRequest testRequest = new RecordingRestRequest(exeRequest);
+ RecordingRestRequest testRequest = new RecordingRestRequest(exeRequest, new RestOperations());
assertEquals(this.baseUri, testRequest.baseUri);
assertEquals(0, testRequest.getRecordedRequests().size());
@@ -35,48 +31,48 @@ public void testCreate() {
@Test
public void testGetWithoutData(){
RequestResult response = recRequest.get("/node");
- assertEquals(0, response.getBatchId());
+ assertEquals(1, response.getBatchId());
assertEquals(1, recRequest.getRecordedRequests().size());
}
@Test
public void testGetWithData(){
RequestResult response = recRequest.get("/node","Test");
- assertEquals(0, response.getBatchId());
+ assertEquals(1, response.getBatchId());
assertEquals(1, recRequest.getRecordedRequests().size());
}
@Test
public void testPost(){
RequestResult response = recRequest.post("/node","Test");
- assertEquals(0, response.getBatchId());
+ assertEquals(1, response.getBatchId());
assertEquals(1, recRequest.getRecordedRequests().size());
}
@Test
public void testPut(){
RequestResult response = recRequest.put("/node","Test");
- assertEquals(0, response.getBatchId());
+ assertEquals(1, response.getBatchId());
assertEquals(1, recRequest.getRecordedRequests().size());
}
@Test
public void testDelete(){
RequestResult response = recRequest.delete("/node");
- assertEquals(0, response.getBatchId());
+ assertEquals(1, response.getBatchId());
assertEquals(1, recRequest.getRecordedRequests().size());
}
@Test
public void testMultipleEntries(){
RequestResult response = recRequest.post("/node","Test");
- assertEquals(0, response.getBatchId());
+ assertEquals(1, response.getBatchId());
assertEquals(1, recRequest.getRecordedRequests().size());
response = recRequest.delete("/node");
- assertEquals(1, response.getBatchId());
+ assertEquals(2, response.getBatchId());
assertEquals(2, recRequest.getRecordedRequests().size());
response = recRequest.get("/node","Test");
- assertEquals(2, response.getBatchId());
+ assertEquals(3, response.getBatchId());
assertEquals(3, recRequest.getRecordedRequests().size());
}
Please sign in to comment.
Something went wrong with that request. Please try again.