System.out.println(response.getEntity(String.class));
}
@Test
public void testCustomerResourceJersey() throws Exception {
Client c = new Client();
WebResource wr = c.resource("http://localhost:" + getJettyPort() + "/customers");
System.out.println("**** CustomerResource No Query params ***");
ClientResponse response = wr.get(ClientResponse.class);
Assert.assertEquals(200, response.getStatus()); // 200 = ok
System.out.println(response.getEntity(String.class));
System.out.println("**** CustomerResource With Query params ***");
response = wr.queryParam("start", "1").queryParam("size", "3").get(ClientResponse.class);
Assert.assertEquals(200, response.getStatus()); // 200 = ok
System.out.println(response.getEntity(String.class));
System.out.println("**** CustomerResource With UriInfo and Query params ***");
// TODO there is probably some better way how to construct that url..
response = c.resource("http://localhost:" + getJettyPort() + "/customers/uriinfo?start=2&size=2").get(ClientResponse.class);
Assert.assertEquals(200, response.getStatus());
System.out.println(response.getEntity(String.class));
}