Search in sources :

Example 41 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.

the class ZipkinMySQLStorageAutoConfigurationTest method strictTraceId_defaultsToTrue.

@Test
public void strictTraceId_defaultsToTrue() {
    context = new AnnotationConfigApplicationContext();
    addEnvironment(context, "zipkin.storage.type:mysql");
    context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinMySQLStorageAutoConfiguration.class);
    context.refresh();
    assertThat(context.getBean(MySQLStorage.class).strictTraceId).isTrue();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Test(org.junit.Test)

Example 42 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.

the class ZipkinUiAutoConfigurationTest method createContextWithOverridenProperty.

private static AnnotationConfigApplicationContext createContextWithOverridenProperty(String pair) {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    addEnvironment(context, pair);
    context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinUiAutoConfiguration.class);
    context.refresh();
    return context;
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext)

Example 43 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.

the class ZipkinElasticsearchHttpStorageAutoConfigurationTest method configuresPipeline.

@Test
public void configuresPipeline() {
    context = new AnnotationConfigApplicationContext();
    addEnvironment(context, "zipkin.storage.type:elasticsearch", "zipkin.storage.elasticsearch.hosts:http://host1:9200", "zipkin.storage.elasticsearch.pipeline:zipkin");
    context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinElasticsearchOkHttpAutoConfiguration.class, ZipkinElasticsearchHttpStorageAutoConfiguration.class);
    context.refresh();
    assertThat(es().pipeline()).isEqualTo("zipkin");
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Test(org.junit.Test)

Example 44 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.

the class ZipkinElasticsearchHttpStorageAutoConfigurationTest method dailyIndexFormat.

@Test
public void dailyIndexFormat() {
    context = new AnnotationConfigApplicationContext();
    addEnvironment(context, "zipkin.storage.type:elasticsearch", "zipkin.storage.elasticsearch.hosts:http://host1:9200");
    context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinElasticsearchOkHttpAutoConfiguration.class, ZipkinElasticsearchHttpStorageAutoConfiguration.class);
    context.refresh();
    assertThat(es().indexNameFormatter().indexNameForTimestamp(0)).isEqualTo("zipkin-1970-01-01");
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Test(org.junit.Test)

Example 45 with AnnotationConfigApplicationContext

use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.

the class ZipkinElasticsearchHttpStorageAutoConfigurationTest method providesStorageComponent_whenStorageTypeElasticsearchAndHostsAreUrls.

@Test
public void providesStorageComponent_whenStorageTypeElasticsearchAndHostsAreUrls() {
    context = new AnnotationConfigApplicationContext();
    addEnvironment(context, "zipkin.storage.type:elasticsearch", "zipkin.storage.elasticsearch.hosts:http://host1:9200");
    context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinElasticsearchOkHttpAutoConfiguration.class, ZipkinElasticsearchHttpStorageAutoConfiguration.class);
    context.refresh();
    assertThat(es()).isNotNull();
}
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