Skip to content

Commit d6a1a3d

Browse files
committed
Merge pull request #35455 from be-hase
* pr/35455: Polish "Fix invalid Zipkin Reporter back-off behavior" Fix invalid Zipkin Reporter back-off behavior Closes gh-35455
2 parents 9245f3c + 4072588 commit d6a1a3d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ ZipkinWebClientSender webClientSender(ZipkinProperties properties,
118118
static class ReporterConfiguration {
119119

120120
@Bean
121-
@ConditionalOnMissingBean
121+
@ConditionalOnMissingBean(Reporter.class)
122122
@ConditionalOnBean(Sender.class)
123123
AsyncReporter<Span> spanReporter(Sender sender, BytesEncoder<Span> encoder) {
124124
return AsyncReporter.builder(sender).build(encoder);

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsReporterConfigurationTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ void shouldNotSupplyReporterIfSenderIsMissing() {
5656

5757
@Test
5858
void shouldBackOffOnCustomBeans() {
59-
this.contextRunner.withUserConfiguration(CustomConfiguration.class).run((context) -> {
60-
assertThat(context).hasBean("customReporter");
61-
assertThat(context).hasSingleBean(Reporter.class);
62-
});
59+
this.contextRunner.withUserConfiguration(SenderConfiguration.class, CustomConfiguration.class)
60+
.run((context) -> {
61+
assertThat(context).hasBean("customReporter");
62+
assertThat(context).hasSingleBean(Reporter.class);
63+
});
6364
}
6465

6566
@Configuration(proxyBeanMethods = false)

0 commit comments

Comments
 (0)