use of org.springframework.security.config.util.InMemoryXmlApplicationContext in project spring-security by spring-projects.
the class LdapServerBeanDefinitionParserTests method embeddedServerCreationContainsExpectedContextSourceAndData.
@Test
public void embeddedServerCreationContainsExpectedContextSourceAndData() {
appCtx = new InMemoryXmlApplicationContext("<ldap-server ldif='classpath:test-server.ldif'/>");
DefaultSpringSecurityContextSource contextSource = (DefaultSpringSecurityContextSource) 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 LdapServerBeanDefinitionParserTests method defaultLdifFileIsSuccessful.
@Test
public void defaultLdifFileIsSuccessful() {
appCtx = new InMemoryXmlApplicationContext("<ldap-server/>");
ApacheDSContainer dsContainer = 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 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 Jsr250AnnotationDrivenBeanDefinitionParserTests method loadContext.
@Before
public void loadContext() {
appContext = new InMemoryXmlApplicationContext("<b:bean id='target' class='org.springframework.security.access.annotation.Jsr250BusinessServiceImpl'/>" + "<global-method-security jsr250-annotations='enabled'/>" + ConfigTestUtils.AUTH_PROVIDER_XML);
target = (BusinessService) appContext.getBean("target");
}
use of org.springframework.security.config.util.InMemoryXmlApplicationContext in project spring-security by spring-projects.
the class SecuredAnnotationDrivenBeanDefinitionParserTests method loadContext.
@Before
public void loadContext() {
SecurityContextHolder.clearContext();
appContext = new InMemoryXmlApplicationContext("<b:bean id='target' class='org.springframework.security.access.annotation.BusinessServiceImpl'/>" + "<global-method-security secured-annotations='enabled'/>" + ConfigTestUtils.AUTH_PROVIDER_XML);
target = (BusinessService) appContext.getBean("target");
}
Aggregations