diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurations.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurations.java index f61d4ce2d9..8a751eaee7 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurations.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurations.java @@ -118,7 +118,7 @@ class ZipkinConfigurations { static class ReporterConfiguration { @Bean - @ConditionalOnMissingBean + @ConditionalOnMissingBean(Reporter.class) @ConditionalOnBean(Sender.class) AsyncReporter spanReporter(Sender sender, BytesEncoder encoder) { return AsyncReporter.builder(sender).build(encoder); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsReporterConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsReporterConfigurationTests.java index 4f5bb4c8e2..b09805215d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsReporterConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsReporterConfigurationTests.java @@ -56,10 +56,11 @@ class ZipkinConfigurationsReporterConfigurationTests { @Test void shouldBackOffOnCustomBeans() { - this.contextRunner.withUserConfiguration(CustomConfiguration.class).run((context) -> { - assertThat(context).hasBean("customReporter"); - assertThat(context).hasSingleBean(Reporter.class); - }); + this.contextRunner.withUserConfiguration(SenderConfiguration.class, CustomConfiguration.class) + .run((context) -> { + assertThat(context).hasBean("customReporter"); + assertThat(context).hasSingleBean(Reporter.class); + }); } @Configuration(proxyBeanMethods = false)