@Test
public void removeCorporateGroupId(){

    final DbOrganization dbOrganization= new DbOrganization();
    dbOrganization.setName("organization1");
    dbOrganization.getCorporateGroupIdPrefixes().add("org.test");
    ArgumentCaptor<DbOrganization> captor = ArgumentCaptor.forClass(DbOrganization.class);
    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, "org.test");
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    verify(repositoryHandler).store((DbOrganization)captor.capture());
    assertFalse(captor.getValue().getCorporateGroupIdPrefixes().contains("org.test"));
}