Examples of commence()


Examples of org.springframework.security.web.access.channel.RetryWithHttpEntryPoint.commence()

        RetryWithHttpEntryPoint ep = new RetryWithHttpEntryPoint();
        ep.setPortResolver(new MockPortResolver(8888, 9999));
        ep.setPortMapper(portMapper);

        ep.commence(request, response);
        assertEquals("http://www.example.com:8888/bigWebApp/hello/pathInfo.html?open=true", response.getRedirectedUrl());
    }
}
View Full Code Here

Examples of org.springframework.security.web.access.channel.RetryWithHttpsEntryPoint.commence()

        RetryWithHttpsEntryPoint ep = new RetryWithHttpsEntryPoint();
        ep.setPortMapper(new PortMapperImpl());
        ep.setPortResolver(new MockPortResolver(80, 443));

        ep.commence(request, response);
        assertEquals("https://www.example.com/bigWebApp/hello/pathInfo.html?open=true", response.getRedirectedUrl());
    }

    public void testNormalOperationWithNullQueryString() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest("GET", "/bigWebApp/hello");
View Full Code Here

Examples of org.springframework.security.web.access.channel.RetryWithHttpsEntryPoint.commence()

        RetryWithHttpsEntryPoint ep = new RetryWithHttpsEntryPoint();
        ep.setPortMapper(new PortMapperImpl());
        ep.setPortResolver(new MockPortResolver(80, 443));

        ep.commence(request, response);
        assertEquals("https://www.example.com/bigWebApp/hello", response.getRedirectedUrl());
    }

    public void testOperationWhenTargetPortIsUnknown() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest("GET", "/bigWebApp");
View Full Code Here

Examples of org.springframework.security.web.access.channel.RetryWithHttpsEntryPoint.commence()

        RetryWithHttpsEntryPoint ep = new RetryWithHttpsEntryPoint();
        ep.setPortMapper(new PortMapperImpl());
        ep.setPortResolver(new MockPortResolver(8768, 1234));

        ep.commence(request, response);
        assertEquals("/bigWebApp?open=true", response.getRedirectedUrl());
    }

    public void testOperationWithNonStandardPort() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest("GET", "/bigWebApp/hello/pathInfo.html");
View Full Code Here

Examples of org.springframework.security.web.access.channel.RetryWithHttpsEntryPoint.commence()

        RetryWithHttpsEntryPoint ep = new RetryWithHttpsEntryPoint();
        ep.setPortResolver(new MockPortResolver(8888, 9999));
        ep.setPortMapper(portMapper);

        ep.commence(request, response);
        assertEquals("https://www.example.com:9999/bigWebApp/hello/pathInfo.html?open=true", response.getRedirectedUrl());
    }
}
View Full Code Here

Examples of org.springframework.security.web.authentication.Http403ForbiddenEntryPoint.commence()

    public void testCommence() {
        MockHttpServletRequest req = new MockHttpServletRequest();
        MockHttpServletResponse resp = new MockHttpServletResponse();
        Http403ForbiddenEntryPoint fep = new Http403ForbiddenEntryPoint();
        try {
            fep.commence(req,resp,new AuthenticationCredentialsNotFoundException("test"));
            assertEquals("Incorrect status",resp.getStatus(),HttpServletResponse.SC_FORBIDDEN);
        } catch (IOException e) {
            fail("Unexpected exception thrown: "+e);
        } catch (ServletException e) {
            fail("Unexpected exception thrown: "+e);
View Full Code Here

Examples of org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint.commence()

        MockHttpServletResponse response = new MockHttpServletResponse();

        //ep.afterPropertiesSet();

        String msg = "These are the jokes kid";
        ep.commence(request, response, new DisabledException(msg));

        assertEquals(401, response.getStatus());
        assertEquals(msg, response.getErrorMessage());

        assertEquals("Basic realm=\"hello\"", response.getHeader("WWW-Authenticate"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.