@Test
public void deleteALicense() throws UnknownHostException, AuthenticationException{

    final String licenseName = "licenseId";
    when(repositoryHandler.getLicense(anyString())).thenReturn(new DbLicense());
    List<DbArtifact> artifacts = new ArrayList<DbArtifact>();
    artifacts.add(new DbArtifact());
    ArgumentCaptor<FiltersHolder> filters = ArgumentCaptor.forClass(FiltersHolder.class);
    when(repositoryHandler.getArtifacts(filters.capture())).thenReturn(artifacts);
    client().addFilter(new HTTPBasicAuthFilter(GrapesTestUtils.USER_4TEST, GrapesTestUtils.PASSWORD_4TEST));
    WebResource resource = client().resource("/" + ServerAPI.LICENSE_RESOURCE + "/" + licenseName);
    ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).delete(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    ArgumentCaptor<String> strCaptor = ArgumentCaptor.forClass(String.class);
    ArgumentCaptor<LicenseMatcher> matcherCaptor = ArgumentCaptor.forClass(LicenseMatcher.class);
    verify(repositoryHandler, times(1)).removeLicenseFromArtifact( (DbArtifact)any(), strCaptor.capture(), matcherCaptor.capture());
    assertEquals(licenseName, strCaptor.getValue());
}