@Test
public void getAnOrganization(){

    final DbOrganization dbOrganization= new DbOrganization();
    dbOrganization.setName("organization1");
    dbOrganization.getCorporateGroupIdPrefixes().add("org.test");
    when(repositoryHandler.getOrganization(dbOrganization.getName())).thenReturn(dbOrganization);
    WebResource resource = client().resource("/" + ServerAPI.ORGANIZATION_RESOURCE + "/" + dbOrganization.getName());
    ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    final Organization organization = response.getEntity(Organization.class);
    assertNotNull(organization);
    assertEquals(dbOrganization.getName(), organization.getName());
    assertEquals(1, organization.getCorporateGroupIdPrefixes().size());
    assertEquals(dbOrganization.getCorporateGroupIdPrefixes().get(0), organization.getCorporateGroupIdPrefixes().get(0));
}