Search in sources :

Example 1 with DefaultSingleSignOnParticipationStrategy

use of org.apereo.cas.web.flow.DefaultSingleSignOnParticipationStrategy in project cas by apereo.

the class RenewAuthenticationRequestCheckActionTests method verifyProceed.

@Test
public void verifyProceed() throws Exception {
    val context = new MockRequestContext();
    val request = new MockHttpServletRequest();
    val response = new MockHttpServletResponse();
    context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
    val strategy = new DefaultSingleSignOnParticipationStrategy(servicesManager, casProperties.getSso(), mock(TicketRegistrySupport.class), mock(AuthenticationServiceSelectionPlan.class));
    val action = new RenewAuthenticationRequestCheckAction(strategy);
    assertEquals(CasWebflowConstants.TRANSITION_ID_PROCEED, action.execute(context).getId());
}
Also used : lombok.val(lombok.val) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) ServletExternalContext(org.springframework.webflow.context.servlet.ServletExternalContext) TicketRegistrySupport(org.apereo.cas.ticket.registry.TicketRegistrySupport) AuthenticationServiceSelectionPlan(org.apereo.cas.authentication.AuthenticationServiceSelectionPlan) MockRequestContext(org.springframework.webflow.test.MockRequestContext) DefaultSingleSignOnParticipationStrategy(org.apereo.cas.web.flow.DefaultSingleSignOnParticipationStrategy) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) MockServletContext(org.apereo.cas.util.MockServletContext) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with DefaultSingleSignOnParticipationStrategy

use of org.apereo.cas.web.flow.DefaultSingleSignOnParticipationStrategy in project cas by apereo.

the class RenewAuthenticationRequestCheckActionTests method verifyRenew.

@Test
public void verifyRenew() throws Exception {
    val context = new MockRequestContext();
    val request = new MockHttpServletRequest();
    request.addParameter(CasProtocolConstants.PARAMETER_RENEW, "true");
    val response = new MockHttpServletResponse();
    context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
    val strategy = new DefaultSingleSignOnParticipationStrategy(servicesManager, casProperties.getSso(), mock(TicketRegistrySupport.class), mock(AuthenticationServiceSelectionPlan.class));
    val action = new RenewAuthenticationRequestCheckAction(strategy);
    assertEquals(CasWebflowConstants.TRANSITION_ID_RENEW, action.execute(context).getId());
}
Also used : lombok.val(lombok.val) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) ServletExternalContext(org.springframework.webflow.context.servlet.ServletExternalContext) TicketRegistrySupport(org.apereo.cas.ticket.registry.TicketRegistrySupport) AuthenticationServiceSelectionPlan(org.apereo.cas.authentication.AuthenticationServiceSelectionPlan) MockRequestContext(org.springframework.webflow.test.MockRequestContext) DefaultSingleSignOnParticipationStrategy(org.apereo.cas.web.flow.DefaultSingleSignOnParticipationStrategy) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) MockServletContext(org.apereo.cas.util.MockServletContext) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

lombok.val (lombok.val)2 AuthenticationServiceSelectionPlan (org.apereo.cas.authentication.AuthenticationServiceSelectionPlan)2 TicketRegistrySupport (org.apereo.cas.ticket.registry.TicketRegistrySupport)2 MockServletContext (org.apereo.cas.util.MockServletContext)2 DefaultSingleSignOnParticipationStrategy (org.apereo.cas.web.flow.DefaultSingleSignOnParticipationStrategy)2 Test (org.junit.jupiter.api.Test)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)2 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)2 ServletExternalContext (org.springframework.webflow.context.servlet.ServletExternalContext)2 MockRequestContext (org.springframework.webflow.test.MockRequestContext)2