@Test
public void removeCorporateGroupIdsButCorporateGroupIdIsMissing(){

    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).delete(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.BAD_REQUEST_400, response.getStatus());
}