use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class SpnegoKnownClientSystemsFilterActionTests method ensureHostnameShouldDoSpnego.
@Test
public void ensureHostnameShouldDoSpnego() throws Exception {
val action = new HostNameSpnegoKnownClientSystemsFilterAction(RegexUtils.createPattern(".+"), StringUtils.EMPTY, 0, "\\w+\\.\\w+\\.\\w+");
val ctx = new MockRequestContext();
val req = new MockHttpServletRequest();
req.setRemoteAddr(ALTERNATE_REMOTE_IP);
val extCtx = new ServletExternalContext(new MockServletContext(), req, new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
val ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class SpnegoKnownClientSystemsFilterActionTests method verifyIpMismatchWhenCheckingHostnameForSpnego.
@Test
public void verifyIpMismatchWhenCheckingHostnameForSpnego() throws Exception {
val action = new HostNameSpnegoKnownClientSystemsFilterAction(RegexUtils.createPattern("14\\..+"), StringUtils.EMPTY, 0, "\\w+\\.\\w+\\.\\w+");
val ctx = new MockRequestContext();
val req = new MockHttpServletRequest();
req.setRemoteAddr(ALTERNATE_REMOTE_IP);
val extCtx = new ServletExternalContext(new MockServletContext(), req, new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
val ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().no(this).getId());
}
use of org.springframework.webflow.action.EventFactorySupport in project cas by apereo.
the class CheckConsentRequiredAction method doExecute.
@Override
public Event doExecute(final RequestContext requestContext) {
val consentEvent = determineConsentEvent(requestContext);
if (StringUtils.isBlank(consentEvent)) {
return null;
}
prepareConsentForRequestContext(requestContext);
return new EventFactorySupport().event(this, consentEvent);
}
Aggregations