Enable ZipkinProperties in ZipkinAutoConfiguration
Closes gh-35592
This commit is contained in:
parent
ad108952c8
commit
d841490f5f
|
|
@ -31,12 +31,13 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for Zipkin.
|
||||
*
|
||||
* <p>
|
||||
* It uses imports on {@link ZipkinConfigurations} to guarantee the correct configuration
|
||||
* ordering.
|
||||
*
|
||||
|
|
@ -48,6 +49,7 @@ import org.springframework.context.annotation.Import;
|
|||
@Import({ SenderConfiguration.class, ReporterConfiguration.class, BraveConfiguration.class,
|
||||
OpenTelemetryConfiguration.class })
|
||||
@ConditionalOnEnabledTracing
|
||||
@EnableConfigurationProperties(ZipkinProperties.class)
|
||||
public class ZipkinAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ class ZipkinAutoConfigurationTests {
|
|||
|
||||
@Test
|
||||
void shouldSupplyBeans() {
|
||||
this.contextRunner.run((context) -> assertThat(context).hasSingleBean(BytesEncoder.class));
|
||||
this.contextRunner.run((context) -> assertThat(context).hasSingleBean(BytesEncoder.class)
|
||||
.hasSingleBean(PropertiesZipkinConnectionDetails.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -83,6 +84,14 @@ class ZipkinAutoConfigurationTests {
|
|||
.doesNotHaveBean(PropertiesZipkinConnectionDetails.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldWorkWithoutSenders() {
|
||||
this.contextRunner
|
||||
.withClassLoader(new FilteredClassLoader("zipkin2.reporter.urlconnection", "org.springframework.web.client",
|
||||
"org.springframework.web.reactive.function.client"))
|
||||
.run((context) -> assertThat(context).hasNotFailed());
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
private static class CustomConfiguration {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue