Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to Jersey 1.1.5

  • Loading branch information...
commit c9f2dbf10b14755cca71d8f3381dfe8e17013006 1 parent 7c3303c
@ept authored
View
8 pom.xml
@@ -46,19 +46,19 @@
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
- <version>1.1.0-ea</version>
+ <version>1.1.5</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
- <version>1.1.0-ea</version>
+ <version>1.1.5</version>
</dependency>
<dependency>
- <groupId>com.sun.jersey.test.framework</groupId>
+ <groupId>com.sun.jersey</groupId>
<artifactId>jersey-test-framework</artifactId>
- <version>1.1.0-ea</version>
+ <version>1.1.5</version>
<scope>test</scope>
</dependency>
View
16 src/test/java/com/eptcomputing/neo4j/rest/Neo4jResourceTest.java
@@ -30,7 +30,7 @@ public Neo4jResourceTest() throws Exception {
* Helper which creates a new entity via the API, and returns its ID.
*/
private long createEntity(JSONObject entity) {
- ClientResponse created = webResource.path("/neo_resource").type("application/json").
+ ClientResponse created = resource().path("/neo_resource").type("application/json").
post(ClientResponse.class, entity);
assertEquals(201, created.getStatus());
return Long.parseLong(created.getLocation().getPath().replaceAll(".*/", ""));
@@ -39,7 +39,7 @@ private long createEntity(JSONObject entity) {
@Test
public void testCreateEntity() throws JSONException {
long id = createEntity(new JSONObject().put("key", "value"));
- JSONObject read = webResource.path(String.format("/neo_resource/%d", id)).get(JSONObject.class);
+ JSONObject read = resource().path(String.format("/neo_resource/%d", id)).get(JSONObject.class);
assertEquals("value", read.get("key"));
}
@@ -50,11 +50,11 @@ public void testUpdateProperties() throws JSONException {
// Delete one, update two, leave three unchanged, add four
JSONObject updated = new JSONObject().put("two", 22).put("three", 3).put("four", 4);
- JSONObject readBack = webResource.path(String.format("/neo_resource/%d", id)).type("application/json").
+ JSONObject readBack = resource().path(String.format("/neo_resource/%d", id)).type("application/json").
put(JSONObject.class, updated);
// Also do a separate read, and make sure both have the right contents
- JSONObject readSeparate = webResource.path(String.format("/neo_resource/%d", id)).get(JSONObject.class);
+ JSONObject readSeparate = resource().path(String.format("/neo_resource/%d", id)).get(JSONObject.class);
JSONObject[] reads = {readBack, readSeparate};
for (JSONObject read : reads) {
try {
@@ -91,11 +91,11 @@ public void testUpdateRelationships() throws JSONException {
).put("_out",
new JSONObject().put("ONE_TWO", one).put("TWO_THREE", new JSONArray().put(three).put(four))
);
- JSONObject readBack = webResource.path(String.format("/neo_resource/%d", two)).type("application/json").
+ JSONObject readBack = resource().path(String.format("/neo_resource/%d", two)).type("application/json").
put(JSONObject.class, twoUpdate);
// Also do a separate read, and make sure both have the right contents
- JSONObject readSeparate = webResource.path(String.format("/neo_resource/%d", two)).get(JSONObject.class);
+ JSONObject readSeparate = resource().path(String.format("/neo_resource/%d", two)).get(JSONObject.class);
JSONObject[] reads = {readBack, readSeparate};
for (JSONObject read : reads) {
JSONObject in = read.getJSONObject("_in");
@@ -127,10 +127,10 @@ public void testDeleteEntity() throws JSONException {
));
// Delete the first and check that it has gone
- JSONObject response = webResource.path(String.format("/neo_resource/%d", id)).delete(JSONObject.class);
+ JSONObject response = resource().path(String.format("/neo_resource/%d", id)).delete(JSONObject.class);
assertEquals("value", response.get("key"));
try {
- webResource.path(String.format("/neo_resource/%d", id)).get(JSONObject.class);
+ resource().path(String.format("/neo_resource/%d", id)).get(JSONObject.class);
fail("Accessing an entity after it has been deleted should return 404");
} catch (UniformInterfaceException e) {
assertEquals(404, e.getResponse().getStatus());
Please sign in to comment.
Something went wrong with that request. Please try again.