Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Commit

Permalink
refactoring the MyDomainObjectResource, making its test work in a ful…
Browse files Browse the repository at this point in the history
…ly integrated environment. (finally fixes #7)
  • Loading branch information
ascandroli committed Apr 1, 2012
1 parent ed33a93 commit 6966f3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public List<MyDomainObject> getAllDomains()
public Response post(MyDomainObject domainObject)
{
persistenceService.save(domainObject);
return Response.ok().build();
return Response.status(Response.Status.CREATED).entity(domainObject).build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public void post() throws Exception

ClientResponse response = (ClientResponse) resource.post(dummy);

Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode());
Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode());
dummy = (MyDomainObject) response.getEntity(MyDomainObject.class);

response.releaseConnection();

MyDomainObject actual = resource.getDomainObject(1l);
MyDomainObject actual = resource.getDomainObject(dummy.getId());

Assert.assertEquals(actual.getName(), dummy.getName());

}

}

0 comments on commit 6966f3c

Please sign in to comment.