Beispiel #1
0
  @Test
  public void getDbOrganizationFromOrganization() {
    final Organization organization = DataModelFactory.createOrganization("test");
    organization.getCorporateGroupIdPrefixes().add("com.test");

    final ModelMapper modelMapper = new ModelMapper(mock(RepositoryHandler.class));
    final DbOrganization dbOrganization = modelMapper.getDbOrganization(organization);

    assertEquals(organization.getName(), dbOrganization.getName());
    assertEquals(1, dbOrganization.getCorporateGroupIdPrefixes().size());
    assertEquals(
        organization.getCorporateGroupIdPrefixes().get(0),
        dbOrganization.getCorporateGroupIdPrefixes().get(0));
  }
Beispiel #2
0
  @Test
  public void getOrganizationFromDbOrganization() {
    final DbOrganization dbOrganization = new DbOrganization();
    dbOrganization.setName("test");
    dbOrganization.getCorporateGroupIdPrefixes().add("com.test");

    final ModelMapper modelMapper = new ModelMapper(mock(RepositoryHandler.class));
    final Organization organization = modelMapper.getOrganization(dbOrganization);

    assertEquals(dbOrganization.getName(), organization.getName());
    assertEquals(1, organization.getCorporateGroupIdPrefixes().size());
    assertEquals(
        dbOrganization.getCorporateGroupIdPrefixes().get(0),
        organization.getCorporateGroupIdPrefixes().get(0));
  }