use of org.apereo.cas.web.support.DefaultArgumentExtractor in project cas by apereo.
the class WebUtilTests method verifyFindService.
@Test
public void verifyFindService() {
final DefaultArgumentExtractor casArgumentExtractor = new DefaultArgumentExtractor(new WebApplicationServiceFactory());
final MockHttpServletRequest request = new MockHttpServletRequest();
request.setParameter(CasProtocolConstants.PARAMETER_SERVICE, "test");
final Service service = WebUtils.getService(Arrays.asList(casArgumentExtractor), request);
assertNotNull(service);
assertEquals("test", service.getId());
}
use of org.apereo.cas.web.support.DefaultArgumentExtractor in project cas by apereo.
the class InitialFlowSetupActionCookieTests method setUp.
@Before
public void setUp() throws Exception {
this.warnCookieGenerator = new CookieRetrievingCookieGenerator("warn", "", 2, false, null);
this.warnCookieGenerator.setCookiePath(StringUtils.EMPTY);
this.tgtCookieGenerator = new CookieRetrievingCookieGenerator("tgt", "", 2, false, null);
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, tgtCookieGenerator, warnCookieGenerator, casProperties);
this.action.afterPropertiesSet();
}
Aggregations