use of org.springframework.security.config.util.InMemoryXmlApplicationContext in project spring-security by spring-projects.
the class LdapServerBeanDefinitionParserTests method defaultLdifFileIsSuccessful.
@Test
public void defaultLdifFileIsSuccessful() {
this.appCtx = new InMemoryXmlApplicationContext("<ldap-server/>");
ApacheDSContainer dsContainer = this.appCtx.getBean(ApacheDSContainer.class);
assertThat(ReflectionTestUtils.getField(dsContainer, "ldifResources")).isEqualTo("classpath*:*.ldif");
}
use of org.springframework.security.config.util.InMemoryXmlApplicationContext in project spring-security by spring-projects.
the class LdapServerBeanDefinitionParserTests method embeddedServerCreationContainsExpectedContextSourceAndData.
@Test
public void embeddedServerCreationContainsExpectedContextSourceAndData() {
this.appCtx = new InMemoryXmlApplicationContext("<ldap-server ldif='classpath:test-server.ldif' port='0'/>");
DefaultSpringSecurityContextSource contextSource = (DefaultSpringSecurityContextSource) this.appCtx.getBean(BeanIds.CONTEXT_SOURCE);
// Check data is loaded
LdapTemplate template = new LdapTemplate(contextSource);
template.lookup("uid=ben,ou=people");
}
use of org.springframework.security.config.util.InMemoryXmlApplicationContext in project spring-security by spring-projects.
the class Jsr250AnnotationDrivenBeanDefinitionParserTests method loadContext.
@BeforeEach
public void loadContext() {
// @formatter:off
this.appContext = new InMemoryXmlApplicationContext("<b:bean id='target' class='org.springframework.security.access.annotation.Jsr250BusinessServiceImpl'/>" + "<global-method-security jsr250-annotations='enabled'/>" + ConfigTestUtils.AUTH_PROVIDER_XML);
// @formatter:on
this.target = (BusinessService) this.appContext.getBean("target");
}
use of org.springframework.security.config.util.InMemoryXmlApplicationContext in project spring-security by spring-projects.
the class SessionManagementConfigServlet31Tests method loadContext.
private void loadContext(String context) {
this.context = new InMemoryXmlApplicationContext(context);
this.springSecurityFilterChain = this.context.getBean("springSecurityFilterChain", Filter.class);
}
use of org.springframework.security.config.util.InMemoryXmlApplicationContext in project spring-security by spring-projects.
the class SecuredAnnotationDrivenBeanDefinitionParserTests method loadContext.
@BeforeEach
public void loadContext() {
SecurityContextHolder.clearContext();
this.appContext = new InMemoryXmlApplicationContext("<b:bean id='target' class='org.springframework.security.access.annotation.BusinessServiceImpl'/>" + "<global-method-security secured-annotations='enabled'/>" + ConfigTestUtils.AUTH_PROVIDER_XML);
this.target = (BusinessService) this.appContext.getBean("target");
}
Aggregations