public static HttpServletRequest createRequest(String requestUri, String servletPath, String pathInfo) {
        HttpServletRequest request = createNiceMock(HttpServletRequest.class);
        expect(request.getContextPath()).andReturn(CONTEXT_PATH).anyTimes();
        expect(request.getRequestURI()).andReturn(requestUri).anyTimes();
        expect(request.getServletPath()).andReturn(servletPath).anyTimes();
        expect(request.getPathInfo()).andReturn(pathInfo).anyTimes();
        replay(request);

        return request;
    }
Tests the following assumptions:

<pre>
URL                 Must match pattern      Must not match pattern
/foo/               /foo/*                  /foo* || /foo
/foo/bar            /foo/*                  /foo* || /foo
/foo                /foo                    /foo/*
</pre>
web/src/test/java/org/apache/shiro/web/filter/PathMatchingFilterParameterizedTest.java