@Test
    @Configuration("{" +
            "  \"ttl\" : 5," +
            "  \"cachingResourcesSettingsEntries\" : [{\"statusCode\": \"*\", \"pathPattern\": \"/foo/.+/bar\", \"httpMethod\": \"*\"}]" +
            "}")
    public void testCachingPathPatternWildcardInfix() throws Throwable {
        //Do first request which should be cached
        final String originalUri = "/foo/test/bar";
        PolicyTestRequest request = PolicyTestRequest.build(PolicyTestRequestType.GET, originalUri);
        assertRequestIsCached(request);

        //Do request which should not be cached by pathPattern
        final String notCachedOriginalUri = "/bar/test/foo";
        PolicyTestRequest requestNoCache = PolicyTestRequest.build(PolicyTestRequestType.GET, notCachedOriginalUri);
        assertRequestNotCached(requestNoCache);
    }
Verify that caching works with pathpattern containing a wildcard in the middle of a path
@throws Throwable
gateway/engine/policies/src/test/java/io/apiman/gateway/engine/policies/CachingResourcesPolicyTest.java