@Test
public void addCorporateGroupId(){

    final DbOrganization dbOrganization= new DbOrganization();
    dbOrganization.setName("organization1");
    dbOrganization.getCorporateGroupIdPrefixes().add("org.test");
    final RepositoryHandler repositoryHandler = mock(RepositoryHandler.class);
    ArgumentCaptor<DbOrganization> captor = ArgumentCaptor.forClass(DbOrganization.class);
    when(repositoryHandler.getOrganization(dbOrganization.getName())).thenReturn(dbOrganization);
    final OrganizationHandler handler = new OrganizationHandler(repositoryHandler);
    handler.addCorporateGroupId(dbOrganization.getName(), "com.test");
    verify(repositoryHandler, times(1)).store(captor.capture());
    assertTrue(captor.getValue().getCorporateGroupIdPrefixes().contains("com.test"));
    verify(repositoryHandler, times(1)).addModulesOrganization("com.test", dbOrganization);
}