Skip to content

Commit f4db7df

Browse files
committed
<modify>: adjust filter's order.
1 parent 2049c17 commit f4db7df

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ void shouldPreferWebClientInNonWebApplicationAndHttpClientSenderIsNotAvailable()
131131
@Test
132132
void willUseRestTemplateInNonWebApplicationIfSenderAndWebClientAreNotAvailable() {
133133
this.contextRunner.withUserConfiguration(RestTemplateConfiguration.class)
134-
.withClassLoader(new FilteredClassLoader(URLConnectionSender.class, WebClient.class))
134+
.withClassLoader(new FilteredClassLoader(HttpClient.class, WebClient.class))
135135
.run((context) -> {
136-
assertThat(context).doesNotHaveBean(URLConnectionSender.class);
136+
assertThat(context).doesNotHaveBean(HttpClient.class);
137137
assertThat(context).hasSingleBean(BytesMessageSender.class);
138138
assertThat(context).hasSingleBean(ZipkinRestTemplateSender.class);
139139
});
@@ -202,27 +202,31 @@ void shouldApplyZipkinRestTemplateBuilderCustomizers() throws IOException {
202202
}
203203
}
204204

205+
// passed
205206
@Test
206207
void shouldUseCustomHttpEndpointSupplierFactory() {
207208
this.contextRunner.withUserConfiguration(CustomHttpEndpointSupplierFactoryConfiguration.class)
209+
.withClassLoader(new FilteredClassLoader(HttpClient.class, WebClient.class, RestTemplate.class))
208210
.run((context) -> assertThat(context.getBean(URLConnectionSender.class))
209211
.extracting("delegate.endpointSupplier")
210212
.isInstanceOf(CustomHttpEndpointSupplier.class));
211213
}
212214

215+
// passed
213216
@Test
214217
void shouldUseCustomHttpEndpointSupplierFactoryWhenReactive() {
215218
this.reactiveContextRunner.withUserConfiguration(WebClientConfiguration.class)
216-
.withClassLoader(new FilteredClassLoader(URLConnectionSender.class))
219+
.withClassLoader(new FilteredClassLoader(HttpClient.class))
217220
.withUserConfiguration(CustomHttpEndpointSupplierFactoryConfiguration.class)
218221
.run((context) -> assertThat(context.getBean(ZipkinWebClientSender.class)).extracting("endpointSupplier")
219222
.isInstanceOf(CustomHttpEndpointSupplier.class));
220223
}
221224

225+
// passed
222226
@Test
223227
void shouldUseCustomHttpEndpointSupplierFactoryWhenRestTemplate() {
224228
this.contextRunner.withUserConfiguration(RestTemplateConfiguration.class)
225-
.withClassLoader(new FilteredClassLoader(URLConnectionSender.class, WebClient.class))
229+
.withClassLoader(new FilteredClassLoader(HttpClient.class, WebClient.class))
226230
.withUserConfiguration(CustomHttpEndpointSupplierFactoryConfiguration.class)
227231
.run((context) -> assertThat(context.getBean(ZipkinRestTemplateSender.class)).extracting("endpointSupplier")
228232
.isInstanceOf(CustomHttpEndpointSupplier.class));

0 commit comments

Comments
 (0)