本文整理汇总了Java中org.jasig.cas.web.support.CasArgumentExtractor类的典型用法代码示例。如果您正苦于以下问题:Java CasArgumentExtractor类的具体用法?Java CasArgumentExtractor怎么用?Java CasArgumentExtractor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CasArgumentExtractor类属于org.jasig.cas.web.support包,在下文中一共展示了CasArgumentExtractor类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.warnCookieGenerator = new CookieRetrievingCookieGenerator();
this.warnCookieGenerator.setCookiePath("");
this.tgtCookieGenerator = new CookieRetrievingCookieGenerator();
this.tgtCookieGenerator.setCookiePath("");
this.action.setTicketGrantingTicketCookieGenerator(this.tgtCookieGenerator);
this.action.setWarnCookieGenerator(this.warnCookieGenerator);
final ArgumentExtractor[] argExtractors = new ArgumentExtractor[] {new CasArgumentExtractor()};
this.action.setArgumentExtractors(Arrays.asList(argExtractors));
this.servicesManager = mock(ServicesManager.class);
when(this.servicesManager.findServiceBy(any(Service.class))).thenReturn(TestUtils.getRegisteredService("test"));
this.action.setServicesManager(this.servicesManager);
this.action.afterPropertiesSet();
}
示例2: testServiceWithNoAttributeValue
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Test
public void testServiceWithNoAttributeValue() {
final List<ArgumentExtractor> set = new ArrayList<>();
set.add(new CasArgumentExtractor());
final MultiFactorWebApplicationServiceFactory factory = mock(MultiFactorWebApplicationServiceFactory.class);
final AuthenticationMethodVerifier verifier = mock(AuthenticationMethodVerifier.class);
final RegisteredService svc = TestUtils.getRegisteredService(CAS_SERVICE);
final DefaultRegisteredServiceProperty prop = new DefaultRegisteredServiceProperty();
svc.getProperties().put(MultiFactorAuthenticationSupportingWebApplicationService.CONST_PARAM_AUTHN_METHOD, prop);
final ServicesManager mgmr = mock(ServicesManager.class);
when(mgmr.findServiceBy(anyInt())).thenReturn(svc);
when(mgmr.findServiceBy(any(Service.class))).thenReturn(svc);
final RegisteredServiceAttributeMultiFactorAuthenticationArgumentExtractor extractor =
new RegisteredServiceAttributeMultiFactorAuthenticationArgumentExtractor(set, factory, mgmr, verifier);
final MultiFactorAuthenticationSupportingWebApplicationService webSvc =
(MultiFactorAuthenticationSupportingWebApplicationService) extractor.extractService(getRequest());
assertNull(webSvc);
}
开发者ID:Unicon,项目名称:cas-mfa,代码行数:24,代码来源:RegisteredServiceAttributeMultiFactorAuthenticationArgumentExtractorTests.java
示例3: testServiceWithDifferentServiceType
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Test
public void testServiceWithDifferentServiceType() {
final List<ArgumentExtractor> set = new ArrayList<>();
set.add(new CasArgumentExtractor());
final MultiFactorWebApplicationServiceFactory factory = mock(MultiFactorWebApplicationServiceFactory.class);
final AuthenticationMethodVerifier verifier = mock(AuthenticationMethodVerifier.class);
final RegisteredService svc = mock(RegisteredService.class);
when(svc.getId()).thenReturn(0L);
when(svc.getServiceId()).thenReturn(CAS_SERVICE);
final ServicesManager mgmr = mock(ServicesManager.class);
when(mgmr.findServiceBy(anyInt())).thenReturn(svc);
when(mgmr.findServiceBy(any(Service.class))).thenReturn(svc);
final RegisteredServiceAttributeMultiFactorAuthenticationArgumentExtractor extractor =
new RegisteredServiceAttributeMultiFactorAuthenticationArgumentExtractor(set, factory, mgmr, verifier);
final MultiFactorAuthenticationSupportingWebApplicationService webSvc =
(MultiFactorAuthenticationSupportingWebApplicationService) extractor.extractService(getRequest());
assertNull(webSvc);
}
开发者ID:Unicon,项目名称:cas-mfa,代码行数:24,代码来源:RegisteredServiceAttributeMultiFactorAuthenticationArgumentExtractorTests.java
示例4: verifyFindService
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Test
public void verifyFindService() {
final SamlArgumentExtractor openIdArgumentExtractor = new SamlArgumentExtractor();
final CasArgumentExtractor casArgumentExtractor = new CasArgumentExtractor();
final ArgumentExtractor[] argumentExtractors = new ArgumentExtractor[] {
openIdArgumentExtractor, casArgumentExtractor};
final MockHttpServletRequest request = new MockHttpServletRequest();
request.setParameter("service", "test");
final Service service = WebUtils.getService(Arrays
.asList(argumentExtractors), request);
assertEquals("test", service.getId());
}
示例5: onSetUp
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Before
public void onSetUp() throws Exception {
final StaticApplicationContext context = new StaticApplicationContext();
context.refresh();
this.serviceValidateController = new ServiceValidateController();
this.serviceValidateController.setCentralAuthenticationService(getCentralAuthenticationService());
final Cas20ProxyHandler proxyHandler = new Cas20ProxyHandler();
proxyHandler.setHttpClient(new SimpleHttpClientFactoryBean().getObject());
this.serviceValidateController.setProxyHandler(proxyHandler);
this.serviceValidateController.setApplicationContext(context);
this.serviceValidateController.setArgumentExtractor(new CasArgumentExtractor());
this.serviceValidateController.setServicesManager(this.servicesManager);
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:14,代码来源:AbstractServiceValidateControllerTests.java
示例6: setUp
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.warnCookieGenerator = new CookieRetrievingCookieGenerator();
this.tgtCookieGenerator = new CookieRetrievingCookieGenerator();
this.action.setTicketGrantingTicketCookieGenerator(this.tgtCookieGenerator);
this.action.setWarnCookieGenerator(this.warnCookieGenerator);
final ArgumentExtractor[] argExtractors = new ArgumentExtractor[] {new CasArgumentExtractor()};
this.action.setArgumentExtractors(Arrays.asList(argExtractors));
this.servicesManager = mock(ServicesManager.class);
when(this.servicesManager.findServiceBy(any(Service.class))).thenReturn(TestUtils.getRegisteredService("test"));
this.action.setServicesManager(this.servicesManager);
this.action.afterPropertiesSet();
}
示例7: testFindService
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Test
public void testFindService() {
final SamlArgumentExtractor openIdArgumentExtractor = new SamlArgumentExtractor();
final CasArgumentExtractor casArgumentExtractor = new CasArgumentExtractor();
final ArgumentExtractor[] argumentExtractors = new ArgumentExtractor[] {
openIdArgumentExtractor, casArgumentExtractor};
final MockHttpServletRequest request = new MockHttpServletRequest();
request.setParameter("service", "test");
final Service service = WebUtils.getService(Arrays
.asList(argumentExtractors), request);
assertEquals("test", service.getId());
}
示例8: setUp
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.warnCookieGenerator = new CookieRetrievingCookieGenerator();
this.warnCookieGenerator.setCookiePath("");
this.tgtCookieGenerator = new CookieRetrievingCookieGenerator();
this.tgtCookieGenerator.setCookiePath("");
this.action.setTicketGrantingTicketCookieGenerator(this.tgtCookieGenerator);
this.action.setWarnCookieGenerator(this.warnCookieGenerator);
final ArgumentExtractor[] argExtractors = new ArgumentExtractor[] {new CasArgumentExtractor()};
this.action.setArgumentExtractors(Arrays.asList(argExtractors));
this.action.afterPropertiesSet();
this.action.afterPropertiesSet();
}
示例9: onSetUp
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Before
public void onSetUp() throws Exception {
StaticApplicationContext context = new StaticApplicationContext();
context.refresh();
this.serviceValidateController = new ServiceValidateController();
this.serviceValidateController.setCentralAuthenticationService(getCentralAuthenticationService());
final Cas20ProxyHandler proxyHandler = new Cas20ProxyHandler();
proxyHandler.setHttpClient(new SimpleHttpClient());
this.serviceValidateController.setProxyHandler(proxyHandler);
this.serviceValidateController.setApplicationContext(context);
this.serviceValidateController.setArgumentExtractor(new CasArgumentExtractor());
}
示例10: setUp
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.servicesManager = new DefaultServicesManagerImpl(new InMemoryServiceRegistryDaoImpl());
this.serviceThemeResolver = new ServiceThemeResolver();
this.serviceThemeResolver.setDefaultThemeName("test");
this.serviceThemeResolver.setServicesManager(this.servicesManager);
this.serviceThemeResolver.setArgumentExtractors(Arrays.asList((ArgumentExtractor) new CasArgumentExtractor()));
final Map<String, String> mobileBrowsers = new HashMap<String, String>();
mobileBrowsers.put("Mozilla", "theme");
this.serviceThemeResolver.setMobileBrowsers(mobileBrowsers);
}
示例11: setUp
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
this.warnCookieGenerator = new CookieRetrievingCookieGenerator();
this.tgtCookieGenerator = new CookieRetrievingCookieGenerator();
this.action.setTicketGrantingTicketCookieGenerator(this.tgtCookieGenerator);
this.action.setWarnCookieGenerator(this.warnCookieGenerator);
final ArgumentExtractor[] argExtractors = new ArgumentExtractor[] {new CasArgumentExtractor()};
this.action.setArgumentExtractors(Arrays.asList(argExtractors));
this.action.afterPropertiesSet();
this.action.afterPropertiesSet();
}
示例12: testServiceWithDefaultMfaAttribute
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
@Test
public void testServiceWithDefaultMfaAttribute() {
final List<ArgumentExtractor> set = new ArrayList<>();
set.add(new CasArgumentExtractor());
final MultiFactorWebApplicationServiceFactory factory = mock(MultiFactorWebApplicationServiceFactory.class);
when(factory.create(anyString(), anyString(), anyString(), any(Response.ResponseType.class),
anyString(), any(AuthenticationMethodSource.class)))
.thenReturn(getMfaService());
final AuthenticationMethodVerifier verifier = mock(AuthenticationMethodVerifier.class);
final RegisteredService svc = TestUtils.getRegisteredService(CAS_SERVICE);
final DefaultRegisteredServiceProperty prop = new DefaultRegisteredServiceProperty();
prop.setValues(Collections.singleton(CAS_AUTHN_METHOD));
svc.getProperties().put(MultiFactorAuthenticationSupportingWebApplicationService.CONST_PARAM_AUTHN_METHOD, prop);
final ServicesManager mgmr = mock(ServicesManager.class);
when(mgmr.findServiceBy(anyInt())).thenReturn(svc);
when(mgmr.findServiceBy(any(Service.class))).thenReturn(svc);
final RegisteredServiceAttributeMultiFactorAuthenticationArgumentExtractor extractor =
new RegisteredServiceAttributeMultiFactorAuthenticationArgumentExtractor(set, factory, mgmr, verifier);
final MultiFactorAuthenticationSupportingWebApplicationService webSvc =
(MultiFactorAuthenticationSupportingWebApplicationService) extractor.extractService(getRequest());
assertNotNull(webSvc);
assertEquals(webSvc.getAuthenticationMethod(), CAS_AUTHN_METHOD);
}
开发者ID:Unicon,项目名称:cas-mfa,代码行数:30,代码来源:RegisteredServiceAttributeMultiFactorAuthenticationArgumentExtractorTests.java
示例13: RequestParameterMultiFactorAuthenticationArgumentExtractorTests
import org.jasig.cas.web.support.CasArgumentExtractor; //导入依赖的package包/类
public RequestParameterMultiFactorAuthenticationArgumentExtractorTests() {
this.supportedArgumentExtractors = new ArrayList<>();
this.supportedArgumentExtractors.add(new CasArgumentExtractor());
this.supportedArgumentExtractors.add(new SamlArgumentExtractor());
this.mfaWebApplicationServiceFactory = new DefaultMultiFactorWebApplicationServiceFactory();
}
开发者ID:Unicon,项目名称:cas-mfa,代码行数:7,代码来源:RequestParameterMultiFactorAuthenticationArgumentExtractorTests.java