use of org.apereo.cas.web.flow.login.SetServiceUnauthorizedRedirectUrlAction in project cas by apereo.
the class SetServiceUnauthorizedRedirectUrlActionTests method verifyOperation.
@Test
public void verifyOperation() throws Exception {
val context = new MockRequestContext();
val request = new MockHttpServletRequest();
val response = new MockHttpServletResponse();
context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
val action = new SetServiceUnauthorizedRedirectUrlAction(getServicesManager());
val service = getWebApplicationServiceFactory().createService("https://github.com/apereo/cas");
WebUtils.putRegisteredService(context, getServicesManager().findServiceBy(service));
action.execute(context);
assertNotNull(WebUtils.getUnauthorizedRedirectUrlFromFlowScope(context));
}
Aggregations