@Test
public void testIsToValidate(TestContext context){

    storage.putMockData(VALIDATION_URI, RESOURCE_GET_PUT);
    ValidationHandler validationHandler = new ValidationHandler(validationResourceManager, storage, httpClient, SCHEMA_ROOT);
    sendValidationResourcesUpdate(RESOURCE_GET_PUT);
    class PUTToUnmanagedResourceRequest extends HttpServerRequestMock{
        @Override public HttpMethod method() {
            return HttpMethod.PUT;
        }
        @Override public String uri() {
            return "/some/other/resource";
        }
        @Override public String path() {
            return "/some/other/resource";
        }
    }
    context.assertFalse(validationHandler.isToValidate(new PUTToUnmanagedResourceRequest()), "PUT Requests to not managed resources should not be validated");
    class PUTToGateleenSomeResourceRequest extends HttpServerRequestMock{
        @Override public HttpMethod method() {
            return HttpMethod.PUT;
        }
        @Override public String uri() {
            return "/gateleen/resources/someResource";
        }
        @Override public String path() {
            return "/gateleen/resources/someResource";
        }
    }
    context.assertTrue(validationHandler.isToValidate(new PUTToGateleenSomeResourceRequest()), "PUT Requests to some resource should be validated");
    sendValidationResourcesUpdate(RESOURCE_GET);
    context.assertFalse(validationHandler.isToValidate(new PUTToGateleenSomeResourceRequest()), "Now, PUT Requests to some resource should not be validated anymore (only GET Requests)");
    context.assertFalse(validationHandler.isToValidate(new PUTToUnmanagedResourceRequest()), "PUT Requests to not managed resources should not be validated");
    class GETToGateleenSomeResourceRequest extends PUTToGateleenSomeResourceRequest {
        @Override public HttpMethod method() {
            return HttpMethod.GET;
        }
    }
    context.assertTrue(validationHandler.isToValidate(new GETToGateleenSomeResourceRequest()), "GET Requests to some resource should be validated");
    sendValidationResourcesUpdate(OTHER_RESOURCES_GET_PUT);
    context.assertFalse(validationHandler.isToValidate(new GETToGateleenSomeResourceRequest()), "GET Requests to some resource should not be validated");
    context.assertTrue(validationHandler.isToValidate(new PUTToGateleenSomeResourceRequest()), "PUT Requests to some resource should be validated");
    context.assertFalse(validationHandler.isToValidate(new PUTToUnmanagedResourceRequest()), "PUT Requests to not managed resources should not be validated");
    class PUTToGateleenOtherResourceRequest extends HttpServerRequestMock{
        @Override public HttpMethod method() {
            return HttpMethod.PUT;
        }
        @Override public String uri() {
            return "/gateleen/resources/otherResource";
        }
        @Override public String path() {
            return "/gateleen/resources/otherResource";
        }
    }
    class GETToGateleenOtherResourceRequest extends PUTToGateleenOtherResourceRequest {
        @Override public HttpMethod method() {
            return HttpMethod.GET;
        }
    }
    context.assertTrue(validationHandler.isToValidate(new GETToGateleenOtherResourceRequest()), "GET Requests to other resource should be validated");
    context.assertFalse(validationHandler.isToValidate(new PUTToGateleenOtherResourceRequest()), "PUT Requests to other resource should not be validated");
}