Пример #1
0
  @Test
  public void testGetUnknownLicense() throws Exception {
    final DbLicense dbLicense = new DbLicense();
    dbLicense.setName("name");
    dbLicense.setLongName("");
    dbLicense.setComments("");
    dbLicense.setRegexp("");
    dbLicense.setUrl("");

    final ModelMapper modelMapper = new ModelMapper(mock(RepositoryHandler.class));
    final License license = modelMapper.getLicense(dbLicense);

    assertEquals(true, license.isUnknown());
  }
Пример #2
0
  @Test
  public void testGetDbLicense() throws Exception {
    final License license =
        DataModelFactory.createLicense("name", "longName", "comments", "regexp", "url");
    final ModelMapper modelMapper = new ModelMapper(mock(RepositoryHandler.class));
    final DbLicense dbLicense = modelMapper.getDbLicense(license);

    assertEquals(license.getName(), dbLicense.getName());
    assertEquals(license.getLongName(), dbLicense.getLongName());
    assertEquals(license.getComments(), dbLicense.getComments());
    assertEquals(license.getRegexp(), dbLicense.getRegexp());
    assertEquals(license.getUrl(), dbLicense.getUrl());
  }
Пример #3
0
  @Test
  public void testGetLicense() throws Exception {
    final DbLicense dbLicense = new DbLicense();
    dbLicense.setName("name");
    dbLicense.setLongName("long name");
    dbLicense.setComments("comment");
    dbLicense.setRegexp("regexp");
    dbLicense.setUrl("url");

    final ModelMapper modelMapper = new ModelMapper(mock(RepositoryHandler.class));
    final License license = modelMapper.getLicense(dbLicense);

    assertEquals(dbLicense.getName(), license.getName());
    assertEquals(dbLicense.getLongName(), license.getLongName());
    assertEquals(dbLicense.getComments(), license.getComments());
    assertEquals(dbLicense.getRegexp(), license.getRegexp());
    assertEquals(dbLicense.getUrl(), license.getUrl());
  }