@Test
public void getModuleLicenses(){

    // Arrange
    final DbModule module = new DbModule();
    module.setName("module");
    module.setVersion("1.0.0-SNAPSHOT");
    final DbArtifact artifact1 = new DbArtifact();
    artifact1.setArtifactId("artifact1");
    artifact1.setVersion("1.0.0-SNAPSHOT");
    module.addArtifact(artifact1);
    final DbLicense license = new DbLicense();
    license.setName("test");
    license.setLongName("License for Grapes tests");
    artifact1.addLicense(license);
    final RepositoryHandler repositoryHandler = mock(RepositoryHandler.class);
    when(repositoryHandler.getModule(module.getId())).thenReturn(module);
    when(repositoryHandler.getArtifact(artifact1.getGavc())).thenReturn(artifact1);
    // when(repositoryHandler.getMatchingLicenses(license.getName())).thenReturn(asSet(license));
    final ModuleHandler sut = new ModuleHandler(repositoryHandler);
    LicenseMatcher licenseMatcherMock = mock(LicenseMatcher.class);
    when(licenseMatcherMock.getMatchingLicenses(license.getName())).thenReturn(asSet(license));
    // Act
    final List<DbLicense> licenses = sut.getModuleLicenses(module.getId(), licenseMatcherMock);
    // Assert
    assertNotNull(licenses);
    assertEquals(1, licenses.size());
    assertEquals(license, licenses.get(0));
}