@Test
public void getAllProductNames(){

    final List<String> names = Lists.newArrayList("product1", "product2", "product3");
    when(repositoryHandler.getProductNames()).thenReturn(names);
    WebResource resource = client().resource("/" + ServerAPI.PRODUCT_RESOURCE + ServerAPI.GET_NAMES);
    ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    List<?> productNames = (List<?>)response.getEntity(ArrayList.class);
    assertNotNull(productNames);
    assertEquals(3, productNames.size());
}