use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.
the class ZipkinElasticsearchAwsStorageAutoConfigurationTest method doesntProvidesAWSSignatureVersion4_whenStorageTypeElasticsearchAndHostsNotUrls.
@Test
public void doesntProvidesAWSSignatureVersion4_whenStorageTypeElasticsearchAndHostsNotUrls() {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "zipkin.storage.type:elasticsearch");
context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinElasticsearchAwsStorageAutoConfiguration.class);
context.refresh();
thrown.expect(NoSuchBeanDefinitionException.class);
context.getBean(AWSSignatureVersion4.class);
}
use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.
the class ZipkinElasticsearchAwsStorageAutoConfigurationTest method doesntProvideAWSSignatureVersion4_whenStorageTypeNotElasticsearch.
@Test
public void doesntProvideAWSSignatureVersion4_whenStorageTypeNotElasticsearch() {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "zipkin.storage.type:cassandra");
context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinElasticsearchAwsStorageAutoConfiguration.class);
context.refresh();
thrown.expect(NoSuchBeanDefinitionException.class);
context.getBean(AWSSignatureVersion4.class);
}
use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.
the class ZipkinCassandraStorageAutoConfigurationTest method doesntProvidesStorageComponent_whenStorageTypeNotCassandra.
@Test
public void doesntProvidesStorageComponent_whenStorageTypeNotCassandra() {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "zipkin.storage.type:elasticsearch");
context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinCassandraStorageAutoConfiguration.class);
context.refresh();
thrown.expect(NoSuchBeanDefinitionException.class);
context.getBean(CassandraStorage.class);
}
use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.
the class ZipkinCassandraStorageAutoConfigurationTest method canOverridesProperty_contactPoints.
@Test
public void canOverridesProperty_contactPoints() {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "zipkin.storage.type:cassandra", // note snake-case supported
"zipkin.storage.cassandra.contact-points:host1,host2");
context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinCassandraStorageAutoConfiguration.class);
context.refresh();
assertThat(context.getBean(ZipkinCassandraStorageProperties.class).getContactPoints()).isEqualTo("host1,host2");
}
use of org.springframework.context.annotation.AnnotationConfigApplicationContext in project zipkin by openzipkin.
the class ZipkinCassandraStorageAutoConfigurationTest method strictTraceId_defaultsToTrue.
@Test
public void strictTraceId_defaultsToTrue() {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "zipkin.storage.type:cassandra");
context.register(PropertyPlaceholderAutoConfiguration.class, ZipkinCassandraStorageAutoConfiguration.class);
context.refresh();
assertThat(context.getBean(CassandraStorage.class).strictTraceId).isTrue();
}
Aggregations