@Test
    @Configuration("{" +
            "  \"ttl\" : 5," +
            "  \"cachingResourcesSettingsEntries\" : [{\"statusCode\": \"*\", \"pathPattern\": \".*\", \"httpMethod\": \"*\"}]" +
            "}")
    public void testPostRequestCaching() throws Throwable {
        PolicyTestRequest requestCache = PolicyTestRequest.build(PolicyTestRequestType.POST, "/testPostCache");
        requestCache.body("Test");
        Long counterValue = doRequest(requestCache);

        requestCache.body("NotCached");
        Long shouldNotCachedcounterValue = doRequest(requestCache);
        assertNotEquals(counterValue, shouldNotCachedcounterValue);
    }
Verify that requests with specific status code or http method are cached and others not.
@throws Throwable
gateway/engine/policies/src/test/java/io/apiman/gateway/engine/policies/CachingResourcesPolicyTest.java