use of org.springframework.webflow.core.collection.LocalAttributeMap in project cas by apereo.
the class CasWebflowContextConfigurationTests method verifyFlowExecutorByClient.
@Test
public void verifyFlowExecutorByClient() {
final RequestContext ctx = getMockRequestContext();
final LocalAttributeMap map = new LocalAttributeMap<>();
flowExecutorViaClientFlowExecution.launchExecution("login", map, ctx.getExternalContext());
}
use of org.springframework.webflow.core.collection.LocalAttributeMap in project cas by apereo.
the class LogoutActionTests method onSetUp.
@Before
public void onSetUp() throws Exception {
this.request = new MockHttpServletRequest();
this.requestContext = mock(RequestContext.class);
final ServletExternalContext servletExternalContext = mock(ServletExternalContext.class);
when(this.requestContext.getExternalContext()).thenReturn(servletExternalContext);
when(servletExternalContext.getNativeRequest()).thenReturn(request);
when(servletExternalContext.getNativeResponse()).thenReturn(new MockHttpServletResponse());
when(this.requestContext.getFlowScope()).thenReturn(new LocalAttributeMap());
this.serviceManager = new DefaultServicesManager(new InMemoryServiceRegistry());
this.serviceManager.load();
}
use of org.springframework.webflow.core.collection.LocalAttributeMap in project cas by apereo.
the class AbstractAuthenticationAction method doExecute.
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
final String agent = WebUtils.getHttpServletRequestUserAgent();
final GeoLocationRequest geoLocation = WebUtils.getHttpServletRequestGeoLocation();
if (!adaptiveAuthenticationPolicy.apply(agent, geoLocation)) {
final String msg = "Adaptive authentication policy does not allow this request for " + agent + " and " + geoLocation;
final Map<String, Class<? extends Exception>> map = Collections.singletonMap(UnauthorizedAuthenticationException.class.getSimpleName(), UnauthorizedAuthenticationException.class);
final AuthenticationException error = new AuthenticationException(msg, map, Collections.emptyMap());
return new Event(this, CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE, new LocalAttributeMap(CasWebflowConstants.TRANSITION_ID_ERROR, error));
}
final Event serviceTicketEvent = this.serviceTicketRequestWebflowEventResolver.resolveSingle(requestContext);
if (serviceTicketEvent != null) {
fireEventHooks(serviceTicketEvent, requestContext);
return serviceTicketEvent;
}
final Event finalEvent = this.initialAuthenticationAttemptWebflowEventResolver.resolveSingle(requestContext);
fireEventHooks(finalEvent, requestContext);
return finalEvent;
}
use of org.springframework.webflow.core.collection.LocalAttributeMap in project head by mifos.
the class CreateSavingsAccountTest method testStartFlow_CustomerIdNotProvided.
@Test
public void testStartFlow_CustomerIdNotProvided() {
MutableAttributeMap input = new LocalAttributeMap();
MockExternalContext context = new MockExternalContext();
startFlow(input, context);
assertCurrentStateEquals("customerSearchStep");
}
Aggregations