@Test
public void checkAuthenticationOnPostAndDeleteMethods(){

    client().addFilter(new HTTPBasicAuthFilter(GrapesTestUtils.WRONG_USER_4TEST, GrapesTestUtils.WRONG_PASSWORD_4TEST));
    WebResource resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE);
    ClientResponse response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
    resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE);
    response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
    resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE + "/gavc");
    response = resource.type(MediaType.APPLICATION_JSON).delete(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
    resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE + "/gavc" + ServerAPI.GET_LICENSES);
    response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
    resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE + "/gavc" + ServerAPI.GET_LICENSES);
    response = resource.type(MediaType.APPLICATION_JSON).delete(ClientResponse.class);
    resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE + "/gavc" + ServerAPI.SET_DO_NOT_USE);
    response = resource.post(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
    response = resource.type(MediaType.APPLICATION_JSON).delete(ClientResponse.class);
    resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE + "/gavc" + ServerAPI.GET_DOWNLOAD_URL);
    response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
    resource = client().resource("/" + ServerAPI.ARTIFACT_RESOURCE + "/gavc" + ServerAPI.GET_PROVIDER);
    response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
}