Ejemplo n.º 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());
  }
Ejemplo n.º 2
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());
  }