private void requestExpectPolicySuccess(PolicyTestRequestType method, String resource) throws Throwable {
        final PolicyTestRequest request = PolicyTestRequest.build(method, resource);
        final PolicyTestResponse response = send(request);

        assertEquals(HttpURLConnection.HTTP_OK, response.code());
        assertNotNull(response.body());

        // the requested URL is mirrored back by the EchoBackEndApi in its response body
        final Map responseAsMap = jsonMapper.readValue(response.body(), HashMap.class);
        assertEquals(resource, responseAsMap.get("resource"));
    }
Makes a request with the given {@code method} to the specified {@code resource}, expecting an
HTTP 200 OK response from the {@link EchoBackEndApi}.

@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