// Create Post
Response response = target.request().accept(MediaType.APPLICATION_JSON).get();
assertNotNull(response);
assertNotNull(response.readEntity(String.class));
Post post = new Post();
post.setTitle("REST Test");
post.setSlug("rest-test");
response = target.request(MediaType.APPLICATION_JSON).post(Entity.entity(post, MediaType.APPLICATION_JSON));
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
Post newPost = response.readEntity(Post.class);
assertNotNull(newPost);
// Update Post
newPost.setTitle("Updated");
response = target.path("id").path(newPost.getId().toString()).request().put(Entity.entity(newPost, MediaType.APPLICATION_JSON));
assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
// Delete Post
response = target.path("id").path(newPost.getId().toString()).request().delete();
assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
}