@Test
public void doTestPutPrinterBasedOnId() {
WebResource webResource = resource();
LoggingFilter loggingFilter = new LoggingFilter();
webResource.addFilter(loggingFilter);
Printer printer = webResource.path("printers").path("ids").path("P01").accept(MediaType.APPLICATION_JSON).get(Printer.class);
String printerModel = printer.model;
String printerLocation = printer.location;
String printerUrl = printer.url;
printer = new Printer("P01", "Xerox", printerLocation, printerUrl);
ClientResponse response = webResource.path("printers").path("ids").path("P01").type(MediaType.APPLICATION_JSON).put(ClientResponse.class, printer);
Assert.assertEquals("Method: doTestPutPrinterBasedOnId \nMessage: Response status doesn't match the expected value.",
Response.Status.NO_CONTENT, response.getResponseStatus());
printer = webResource.path("printers").path("ids").path("P01").accept(MediaType.APPLICATION_JSON).get(Printer.class);
Assert.assertNotSame("Method: doTestPutPrinterBasedOnId \nMessage: Printer holds the old model inspite of update.", printerModel, printer.model);