@Test
public void getLicenses() {

    final DbModule dbModule = new DbModule();
    dbModule.setName("moduleTest");
    dbModule.setVersion("1.0.0");
    final DbArtifact dbArtifact = new DbArtifact();
    dbArtifact.setGroupId(GrapesTestUtils.CORPORATE_GROUPID_4TEST);
    dbArtifact.setArtifactId("artifact1");
    dbArtifact.setVersion("1.2.3");
    final DbLicense dbLicense = new DbLicense();
    dbLicense.setName("license1");
    dbArtifact.addLicense(dbLicense);
    dbModule.addArtifact(dbArtifact);
    when(repositoryHandler.getModule(dbModule.getId())).thenReturn(dbModule);
    when(repositoryHandler.getArtifact(dbArtifact.getGavc())).thenReturn(dbArtifact);
    when(repositoryHandler.getLicense(dbLicense.getName())).thenReturn(dbLicense);
    final WebResource resource = client().resource("/" + ServerAPI.MODULE_RESOURCE + "/" + dbModule.getName() + "/" + dbModule.getVersion() + ServerAPI.GET_LICENSES);
    final ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    final List<License> results = response.getEntity(new GenericType<List<License>>() {
    });
    assertNotNull(results);
    assertEquals(1, results.size());
    assertEquals(dbLicense.getName(), results.get(0).getName());
}