@Test
public void getAllOrganizationNames(){

    final List<String> names = new ArrayList<String>();
    names.add("organization1");
    when(repositoryHandler.getOrganizationNames()).thenReturn(names);
    WebResource resource = client().resource("/" + ServerAPI.ORGANIZATION_RESOURCE + ServerAPI.GET_NAMES);
    ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    List<?> organization = (List<?>)response.getEntity(List.class);
    assertNotNull(organization);
    assertEquals(1, organization.size());
    assertEquals("organization1", organization.get(0));
}