private void requestExpectPolicyFailure(PolicyTestRequestType method, String resource) throws Throwable {
        final PolicyTestRequest request = PolicyTestRequest.build(method, resource);

        try {
            send(request);
            fail(PolicyFailureError.class + " expected");

        } catch (PolicyFailureError policyFailureError) {
            final PolicyFailure failure = policyFailureError.getFailure();

            assertEquals(HttpURLConnection.HTTP_FORBIDDEN, failure.getFailureCode());
            assertEquals(PolicyFailureType.Authorization, failure.getType());
        }
    }
Makes a request with the given {@code method} to the specified {@code resource}, expecting an
HTTP 403 response.

@param method   the HTTP method
@param resource the resource to request
@throws Throwable
plugins/url-whitelist-policy/src/test/java/io/apiman/plugins/urlwhitelist/UrlWhitelistPolicyTest.java