use of org.apereo.cas.services.InMemoryServiceRegistry in project cas by apereo.
the class ChainingSingleLogoutServiceLogoutUrlBuilderTests method beforeEach.
@BeforeEach
public void beforeEach() {
val appCtx = new StaticApplicationContext();
appCtx.refresh();
val context = ServicesManagerConfigurationContext.builder().serviceRegistry(new InMemoryServiceRegistry(appCtx)).applicationContext(appCtx).environments(new HashSet<>(0)).servicesCache(Caffeine.newBuilder().build()).registeredServiceLocators(List.of(new DefaultServicesManagerRegisteredServiceLocator())).build();
this.servicesManager = new DefaultServicesManager(context);
}
use of org.apereo.cas.services.InMemoryServiceRegistry in project cas by apereo.
the class GroovyDelegatedClientIdentityProviderRedirectionStrategyTests method setup.
@BeforeEach
public void setup() {
val appCtx = new StaticApplicationContext();
appCtx.refresh();
val context = ServicesManagerConfigurationContext.builder().serviceRegistry(new InMemoryServiceRegistry(appCtx)).applicationContext(appCtx).environments(new HashSet<>(0)).servicesCache(Caffeine.newBuilder().build()).registeredServiceLocators(List.of(new DefaultServicesManagerRegisteredServiceLocator())).build();
this.servicesManager = new DefaultServicesManager(context);
}
use of org.apereo.cas.services.InMemoryServiceRegistry in project cas by apereo.
the class DelegatedAuthenticationSingleSignOnParticipationStrategyTests method getSingleSignOnStrategy.
private static SingleSignOnParticipationStrategy getSingleSignOnStrategy(final RegisteredService svc, final TicketRegistry ticketRegistry) {
val appCtx = new StaticApplicationContext();
appCtx.refresh();
val context = ServicesManagerConfigurationContext.builder().serviceRegistry(new InMemoryServiceRegistry(appCtx, List.of(svc), List.of())).applicationContext(appCtx).environments(new HashSet<>(0)).servicesCache(Caffeine.newBuilder().build()).registeredServiceLocators(List.of(new DefaultServicesManagerRegisteredServiceLocator())).build();
val servicesManager = new DefaultServicesManager(context);
servicesManager.load();
val authenticationExecutionPlan = new DefaultAuthenticationEventExecutionPlan();
authenticationExecutionPlan.registerAuthenticationHandler(new SimpleTestUsernamePasswordAuthenticationHandler());
return new DelegatedAuthenticationSingleSignOnParticipationStrategy(servicesManager, new DefaultAuthenticationServiceSelectionPlan(new DefaultAuthenticationServiceSelectionStrategy()), new DefaultTicketRegistrySupport(ticketRegistry));
}
use of org.apereo.cas.services.InMemoryServiceRegistry in project cas by apereo.
the class ServiceThemeResolverTests method setUp.
@Before
public void setUp() throws Exception {
this.servicesManager = new DefaultServicesManager(new InMemoryServiceRegistry());
mobileBrowsers = new HashMap<>();
mobileBrowsers.put(MOZILLA, "theme");
this.serviceThemeResolver = new ServiceThemeResolver(DEFAULT_THEME_NAME, servicesManager, mobileBrowsers);
}
use of org.apereo.cas.services.InMemoryServiceRegistry in project cas by apereo.
the class RegisteredServiceSimpleFormControllerTests method setUp.
@Before
public void setUp() throws Exception {
final Map<String, List<Object>> attributes = new HashMap<>();
attributes.put(TEST_ID, Arrays.asList(new Object[] { TEST_ID }));
this.repository = new StubPersonAttributeDao();
this.repository.setBackingMap(attributes);
this.registeredServiceFactory = new DefaultRegisteredServiceFactory(new DefaultAccessStrategyMapper(), policyMapper, new DefaultProxyPolicyMapper(), new DefaultRegisteredServiceMapper(), new DefaultUsernameAttributeProviderMapper(), Collections.singletonList(new AttributeFormDataPopulator(this.repository)));
this.manager = new DefaultServicesManager(new InMemoryServiceRegistry());
this.controller = new RegisteredServiceSimpleFormController(this.manager, this.registeredServiceFactory);
}
Aggregations