Search in sources :

Example 56 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project spring-security by spring-projects.

the class TestConfiguration method beanNamesAreCorrectlyResolved.

@Test
public void beanNamesAreCorrectlyResolved() throws Exception {
    handler.setApplicationContext(new AnnotationConfigApplicationContext(TestConfiguration.class));
    Expression expression = handler.getExpressionParser().parseExpression("@number10.compareTo(@number20) < 0");
    assertThat(expression.getValue(handler.createEvaluationContext(mock(Authentication.class), new Object()))).isEqualTo(true);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Expression(org.springframework.expression.Expression) Test(org.junit.Test)

Example 57 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project spring-security by spring-projects.

the class WithSecurityContextTestExcecutionListenerTests method setup.

@Before
public void setup() {
    listener = new WithSecurityContextTestExecutionListener();
    context = new AnnotationConfigApplicationContext(Config.class);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Before(org.junit.Before)

Example 58 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project spring-security by spring-projects.

the class CsrfConfigurerNoWebMvcTests method loadContext.

private void loadContext(Class<?> configs) {
    AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext();
    annotationConfigApplicationContext.register(configs);
    annotationConfigApplicationContext.refresh();
    this.context = annotationConfigApplicationContext;
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext)

Example 59 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project camel by apache.

the class SpringLdapComponentTest method createApplicationContext.

@Override
protected AbstractApplicationContext createApplicationContext() {
    AnnotationConfigApplicationContext springContext = new AnnotationConfigApplicationContext();
    springContext.register(SpringLdapTestConfiguration.class);
    springContext.refresh();
    return springContext;
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext)

Example 60 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project spring-framework by spring-projects.

the class EnableCachingIntegrationTests method fooServiceWithInterface.

@Test
public void fooServiceWithInterface() {
    this.context = new AnnotationConfigApplicationContext(FooConfig.class);
    FooService service = this.context.getBean(FooService.class);
    fooGetSimple(service);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Test(org.junit.Test)

Aggregations

AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)800 Test (org.junit.Test)528 DSLContext (org.jooq.DSLContext)53 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)42 ApplicationContext (org.springframework.context.ApplicationContext)25 Before (org.junit.Before)23 DIConfiguration (com.khartec.waltz.service.DIConfiguration)15 Filter (javax.servlet.Filter)15 Map (java.util.Map)14 OncePerRequestFilter (org.springframework.web.filter.OncePerRequestFilter)14 TestBean (org.springframework.tests.sample.beans.TestBean)13 PropertyPlaceholderAutoConfiguration (org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration)12 MockMvc (org.springframework.test.web.servlet.MockMvc)12 EntityKind (com.khartec.waltz.model.EntityKind)11 List (java.util.List)10 RootBeanDefinition (org.springframework.beans.factory.support.RootBeanDefinition)10 MockEnvironment (org.springframework.mock.env.MockEnvironment)10 EntityReference (com.khartec.waltz.model.EntityReference)9 MapPropertySource (org.springframework.core.env.MapPropertySource)9 IOException (java.io.IOException)8