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

    final DbArtifact artifact = new DbArtifact();
    artifact.setGroupId("groupId");
    artifact.setArtifactId("artifactId");
    artifact.setVersion("version");
    artifact.setClassifier("classifier");
    when(repositoryHandler.getArtifact(artifact.getGavc())).thenReturn(artifact);
    client().addFilter(new HTTPBasicAuthFilter(USER_4TEST, PASSWORD_4TEST));
    WebResource resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE + "/" + artifact.getGavc() + ServerAPI.GET_DOWNLOAD_URL);
    ClientResponse response = resource.queryParam(ServerAPI.URL_PARAM, "testUrl").post(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    verify(repositoryHandler, times(1)).updateDownloadUrl(artifact, "testUrl");
}