* method is called after the request is processed, and before the next
* request. Combining these into one test.
*/
@Test
public void testPostConstructAndPreDestroy() {
Resource resource = client.resource(getBaseURI() + "/pojo/message");
ClientResponse response = resource.get();
assertEquals(204, response.getStatusCode());
resource = client.resource(getBaseURI() + "/messageaccess");
response = resource.get();
assertEquals(200, response.getStatusCode());
assertEquals("MyPOJO;myPostConstructMethod;message;myPreDestroyMethod;", response
.getEntity(String.class));
resource = client.resource(getBaseURI() + "/pojo/message");
response = resource.get();
assertEquals(204, response.getStatusCode());
resource = client.resource(getBaseURI() + "/messageaccess");
response = resource.get();
assertEquals(200, response.getStatusCode());
assertEquals("MyPOJO;myPostConstructMethod;message;myPreDestroyMethod;MyPOJO;myPostConstructMethod;message;myPreDestroyMethod;",
response.getEntity(String.class));
}