@Test
public void checkAuthenticationOnPostAndDeleteMethods(){

    WebResource resource = client().resource("/" + ServerAPI.ORGANIZATION_RESOURCE);
    ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).post(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
    resource = client().resource("/" + ServerAPI.ORGANIZATION_RESOURCE + "/organization1");
    response = resource.accept(MediaType.APPLICATION_JSON).delete(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
    resource = client().resource("/" + ServerAPI.ORGANIZATION_RESOURCE + "/organization1" + ServerAPI.GET_CORPORATE_GROUPIDS);
    response = resource.accept(MediaType.APPLICATION_JSON).post(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
    resource = client().resource("/" + ServerAPI.ORGANIZATION_RESOURCE + "/organization1" + ServerAPI.GET_CORPORATE_GROUPIDS);
    response = resource.accept(MediaType.APPLICATION_JSON).delete(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.UNAUTHORIZED_401, response.getStatus());
}