File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed
instrumentation/spring/spring-webflux/spring-webflux-5.3/library/src/test/java/io/opentelemetry/instrumentation/spring/webflux/v5_3 Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 1313import org .junit .jupiter .api .extension .RegisterExtension ;
1414import org .springframework .web .reactive .function .client .WebClient ;
1515
16- class SpringWebfluxClientInstrumentationTest
16+ @ SuppressWarnings ("deprecation" )
17+ class SpringWebfluxClientInstrumentationOldTest
1718 extends AbstractSpringWebfluxClientInstrumentationTest {
1819
1920 @ RegisterExtension
2021 static final InstrumentationExtension testing = HttpClientInstrumentationExtension .forLibrary ();
2122
2223 @ Override
2324 protected WebClient .Builder instrument (WebClient .Builder builder ) {
24- SpringWebfluxClientTelemetry instrumentation =
25- SpringWebfluxClientTelemetry .builder (testing .getOpenTelemetry ())
26- .setCapturedRequestHeaders (
25+ SpringWebfluxTelemetry instrumentation =
26+ SpringWebfluxTelemetry .builder (testing .getOpenTelemetry ())
27+ .setCapturedClientRequestHeaders (
2728 Collections .singletonList (AbstractHttpClientTest .TEST_REQUEST_HEADER ))
28- .setCapturedResponseHeaders (
29+ .setCapturedClientResponseHeaders (
2930 Collections .singletonList (AbstractHttpClientTest .TEST_RESPONSE_HEADER ))
3031 .build ();
31- return builder .filters (instrumentation ::addTracingFilter );
32+ return builder .filters (instrumentation ::addClientTracingFilter );
3233 }
3334}
Original file line number Diff line number Diff line change 1919import org .junit .jupiter .api .extension .RegisterExtension ;
2020import org .springframework .context .ConfigurableApplicationContext ;
2121
22- public final class SpringWebfluxServerInstrumentationTest
22+ public final class SpringWebfluxServerInstrumentationOldTest
2323 extends AbstractHttpServerTest <ConfigurableApplicationContext > {
2424
2525 private static final String CONTEXT_PATH = "/test" ;
@@ -29,7 +29,7 @@ public final class SpringWebfluxServerInstrumentationTest
2929
3030 @ Override
3131 protected ConfigurableApplicationContext setupServer () {
32- return TestWebfluxSpringBootApp .start (port , CONTEXT_PATH );
32+ return TestWebfluxSpringBootOldApp .start (port , CONTEXT_PATH );
3333 }
3434
3535 @ Override
Original file line number Diff line number Diff line change 3737import reactor .core .publisher .Flux ;
3838import reactor .core .publisher .Mono ;
3939
40+ @ SuppressWarnings ("deprecation" )
4041@ SpringBootApplication
41- class TestWebfluxSpringBootApp {
42+ class TestWebfluxSpringBootOldApp {
4243
4344 static ConfigurableApplicationContext start (int port , String contextPath ) {
4445 Properties props = new Properties ();
4546 props .put ("server.port" , port );
4647 props .put ("spring.webflux.base-path" , contextPath );
4748
48- SpringApplication app = new SpringApplication (TestWebfluxSpringBootApp .class );
49+ SpringApplication app = new SpringApplication (TestWebfluxSpringBootOldApp .class );
4950 app .setDefaultProperties (props );
5051 return app .run ();
5152 }
5253
5354 @ Bean
5455 WebFilter telemetryFilter () {
55- return SpringWebfluxServerTelemetry .builder (GlobalOpenTelemetry .get ())
56- .setCapturedRequestHeaders (singletonList (AbstractHttpServerTest .TEST_REQUEST_HEADER ))
57- .setCapturedResponseHeaders (singletonList (AbstractHttpServerTest .TEST_RESPONSE_HEADER ))
56+ return SpringWebfluxTelemetry .builder (GlobalOpenTelemetry .get ())
57+ .setCapturedClientRequestHeaders (singletonList (AbstractHttpServerTest .TEST_REQUEST_HEADER ))
58+ .setCapturedClientResponseHeaders (
59+ singletonList (AbstractHttpServerTest .TEST_RESPONSE_HEADER ))
5860 .build ()
5961 .createWebFilterAndRegisterReactorHook ();
6062 }
You can’t perform that action at this time.
0 commit comments