Search in sources :

Example 66 with AnnotationConfigApplicationContext

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

the class JsonComponentModuleTests method moduleShouldRegisterDeserializers.

@Test
public void moduleShouldRegisterDeserializers() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(JsonComponentModule.class, OnlyDeserializer.class);
    JsonComponentModule module = context.getBean(JsonComponentModule.class);
    assertDeserialize(module);
    context.close();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Test(org.junit.Test)

Example 67 with AnnotationConfigApplicationContext

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

the class JsonComponentModuleTests method moduleShouldRegisterInnerClasses.

@Test
public void moduleShouldRegisterInnerClasses() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(JsonComponentModule.class, NameAndAgeJsonComponent.class);
    JsonComponentModule module = context.getBean(JsonComponentModule.class);
    assertSerialize(module);
    assertDeserialize(module);
    context.close();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Test(org.junit.Test)

Example 68 with AnnotationConfigApplicationContext

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

the class JsonComponentModuleTests method moduleShouldRegisterSerializers.

@Test
public void moduleShouldRegisterSerializers() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(JsonComponentModule.class, OnlySerializer.class);
    JsonComponentModule module = context.getBean(JsonComponentModule.class);
    assertSerialize(module);
    context.close();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Test(org.junit.Test)

Example 69 with AnnotationConfigApplicationContext

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

the class AtomikosDependsOnBeanFactoryPostProcessorTests method setsDependsOn.

@Test
public void setsDependsOn() {
    this.context = new AnnotationConfigApplicationContext(Config.class);
    assertDependsOn("dataSource");
    assertDependsOn("connectionFactory");
    assertDependsOn("userTransactionManager", "dataSource", "connectionFactory");
    assertDependsOn("messageDrivenContainer", "userTransactionManager");
    this.context.close();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Test(org.junit.Test)

Example 70 with AnnotationConfigApplicationContext

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

the class ServletComponentScanRegistrarTests method packagesConfiguredWithValue.

@Test
public void packagesConfiguredWithValue() {
    this.context = new AnnotationConfigApplicationContext(ValuePackages.class);
    ServletComponentRegisteringPostProcessor postProcessor = this.context.getBean(ServletComponentRegisteringPostProcessor.class);
    assertThat(postProcessor.getPackagesToScan()).contains("com.example.foo", "com.example.bar");
}
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