use of org.apereo.cas.web.flow.login.InitialFlowSetupAction in project cas by apereo.
the class InitialFlowSetupCookieActionTests method initialize.
@BeforeEach
public void initialize() throws Exception {
val warn = CookieGenerationContext.builder().name("warn").path(StringUtils.EMPTY).maxAge(2).domain(null).secure(false).httpOnly(false).comment("CAS Cookie").build();
val tgt = CookieGenerationContext.builder().name("tgt").path(StringUtils.EMPTY).maxAge(2).domain(null).secure(false).httpOnly(false).comment("CAS Cookie").build();
this.warnCookieGenerator = new CookieRetrievingCookieGenerator(warn);
this.warnCookieGenerator.setCookiePath(StringUtils.EMPTY);
this.tgtCookieGenerator = new CookieRetrievingCookieGenerator(tgt);
this.tgtCookieGenerator.setCookiePath(StringUtils.EMPTY);
val argExtractors = Collections.<ArgumentExtractor>singletonList(new DefaultArgumentExtractor(new WebApplicationServiceFactory()));
val servicesManager = mock(ServicesManager.class);
when(servicesManager.findServiceBy(any(Service.class))).thenReturn(RegisteredServiceTestUtils.getRegisteredService("test"));
val sso = new SingleSignOnProperties().setCreateSsoCookieOnRenewAuthn(true).setRenewAuthnEnabled(true);
this.action = new InitialFlowSetupAction(argExtractors, servicesManager, authenticationRequestServiceSelectionStrategies, tgtCookieGenerator, warnCookieGenerator, casProperties, authenticationEventExecutionPlan, new DefaultSingleSignOnParticipationStrategy(servicesManager, sso, mock(TicketRegistrySupport.class), mock(AuthenticationServiceSelectionPlan.class)), mock(TicketRegistrySupport.class));
this.action.afterPropertiesSet();
}
use of org.apereo.cas.web.flow.login.InitialFlowSetupAction in project cas by apereo.
the class InitialFlowSetupActionCookieTests method setUp.
@Before
public void setUp() throws Exception {
this.warnCookieGenerator = new CookieRetrievingCookieGenerator("warn", "", 2, false, null, false);
this.warnCookieGenerator.setCookiePath(StringUtils.EMPTY);
this.tgtCookieGenerator = new CookieRetrievingCookieGenerator("tgt", "", 2, false, null, false);
this.tgtCookieGenerator.setCookiePath(StringUtils.EMPTY);
final List<ArgumentExtractor> argExtractors = Collections.singletonList(new DefaultArgumentExtractor(new WebApplicationServiceFactory()));
final ServicesManager servicesManager = mock(ServicesManager.class);
when(servicesManager.findServiceBy(any(Service.class))).thenReturn(RegisteredServiceTestUtils.getRegisteredService("test"));
this.action = new InitialFlowSetupAction(argExtractors, servicesManager, authenticationRequestServiceSelectionStrategies, tgtCookieGenerator, warnCookieGenerator, casProperties);
this.action.afterPropertiesSet();
}
Aggregations