Merge branch '3.0.x'

Closes gh-35546
This commit is contained in:
Phillip Webb 2023-05-17 16:42:38 -07:00
commit 0743da4987
2 changed files with 6 additions and 5 deletions

View File

@ -127,7 +127,7 @@ class ZipkinConfigurations {
static class ReporterConfiguration { static class ReporterConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean(Reporter.class)
@ConditionalOnBean(Sender.class) @ConditionalOnBean(Sender.class)
AsyncReporter<Span> spanReporter(Sender sender, BytesEncoder<Span> encoder) { AsyncReporter<Span> spanReporter(Sender sender, BytesEncoder<Span> encoder) {
return AsyncReporter.builder(sender).build(encoder); return AsyncReporter.builder(sender).build(encoder);

View File

@ -56,10 +56,11 @@ class ZipkinConfigurationsReporterConfigurationTests {
@Test @Test
void shouldBackOffOnCustomBeans() { void shouldBackOffOnCustomBeans() {
this.contextRunner.withUserConfiguration(CustomConfiguration.class).run((context) -> { this.contextRunner.withUserConfiguration(SenderConfiguration.class, CustomConfiguration.class)
assertThat(context).hasBean("customReporter"); .run((context) -> {
assertThat(context).hasSingleBean(Reporter.class); assertThat(context).hasBean("customReporter");
}); assertThat(context).hasSingleBean(Reporter.class);
});
} }
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)