@Test
    void testDefault() throws Exception {
        HttpServletResponse response = createNiceMock(HttpServletResponse.class);
        HttpServletRequest request = createBaseMockRequest();

        expect(response.encodeRedirectURL(eq("http://localhost/"))).andReturn("http://localhost/");
        replay(request);
        replay(response);

        PortFilter filter = new PortFilter();
        boolean result = filter.onAccessDenied(request, response, null);

        verify(request);
        verify(response);
        assertFalse(result);
    }
Tests for the {@link PortFilter} class.

@since 1.1
web/src/test/java/org/apache/shiro/web/filter/authz/PortFilterTest.java