@Test
public void getLicenses() throws UnknownHostException {

    final DbArtifact artifact = new DbArtifact();
    artifact.setGroupId("groupId");
    artifact.setArtifactId("artifactId");
    artifact.setVersion("version");
    final DbLicense license = new DbLicense();
    license.setName("licenseId");
    artifact.addLicense(license);
    when(repositoryHandler.getArtifact(artifact.getGavc())).thenReturn(artifact);
    when(repositoryHandler.getLicense(license.getName())).thenReturn(license);
    WebResource resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE + "/" + artifact.getGavc() + ServerAPI.GET_LICENSES);
    ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    final List<License> licenses = response.getEntity(new GenericType<List<License>>(){});
    assertNotNull(licenses);
    assertEquals(1, licenses.size());
    final ModelMapper modelMapper = new ModelMapper(repositoryHandler);
    assertEquals(modelMapper.getLicense(license), licenses.get(0));
}