@Test
public void getCorporateGroupIds(){

    final DbOrganization dbOrganization= new DbOrganization();
    dbOrganization.setName("organization1");
    dbOrganization.getCorporateGroupIdPrefixes().add("org.test");
    when(repositoryHandler.getOrganization(dbOrganization.getName())).thenReturn(dbOrganization);
    client().addFilter(new HTTPBasicAuthFilter(GrapesTestUtils.USER_4TEST, GrapesTestUtils.PASSWORD_4TEST));
    WebResource resource = client().resource("/" + ServerAPI.ORGANIZATION_RESOURCE + "/" + dbOrganization.getName() + ServerAPI.GET_CORPORATE_GROUPIDS);
    ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    List<?> corporateGroupIds = (List<?>)response.getEntity(List.class);
    assertNotNull(corporateGroupIds);
    assertEquals(1, corporateGroupIds.size());
    assertEquals("org.test", corporateGroupIds.get(0));
}