use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.
the class ZipkinElasticsearchStorageAutoConfigurationTest method strictTraceId_defaultsToTrue.
@Test
public void strictTraceId_defaultsToTrue() {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "zipkin.storage.type:elasticsearch");
context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinElasticsearchStorageAutoConfiguration.class);
context.refresh();
assertThat(es().strictTraceId).isTrue();
}
use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.
the class ZipkinMySQLStorageAutoConfigurationTest method providesStorageComponent_whenStorageTypeMySQL.
@Test
public void providesStorageComponent_whenStorageTypeMySQL() {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "zipkin.storage.type:mysql");
context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinMySQLStorageAutoConfiguration.class);
context.refresh();
assertThat(context.getBean(MySQLStorage.class)).isNotNull();
}
use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.
the class ZipkinMySQLStorageAutoConfigurationTest method canOverridesProperty_username.
@Test
public void canOverridesProperty_username() {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "zipkin.storage.type:mysql", "zipkin.storage.mysql.username:robot");
context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinMySQLStorageAutoConfiguration.class);
context.refresh();
assertThat(context.getBean(ZipkinMySQLStorageProperties.class).getUsername()).isEqualTo("robot");
}
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();
}
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;
}
Aggregations