From f10f0ff5956d8e26279f3899aafdd43a4f3c9bbd Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Wed, 26 Feb 2025 15:22:03 +0200 Subject: [PATCH] webflux: use the same test exception as other tests --- .../webflux/v5_3/SpringWebfluxServerInstrumentationTest.java | 1 - .../spring/webflux/v5_3/TestWebfluxSpringBootApp.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/src/test/java/io/opentelemetry/instrumentation/spring/webflux/v5_3/SpringWebfluxServerInstrumentationTest.java b/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/src/test/java/io/opentelemetry/instrumentation/spring/webflux/v5_3/SpringWebfluxServerInstrumentationTest.java index 54a71116a581..9cc29f1a3df0 100644 --- a/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/src/test/java/io/opentelemetry/instrumentation/spring/webflux/v5_3/SpringWebfluxServerInstrumentationTest.java +++ b/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/src/test/java/io/opentelemetry/instrumentation/spring/webflux/v5_3/SpringWebfluxServerInstrumentationTest.java @@ -41,7 +41,6 @@ public void stopServer(ConfigurableApplicationContext applicationContext) { protected void configure(HttpServerTestOptions options) { options.setContextPath(CONTEXT_PATH); options.setTestPathParam(true); - options.setExpectedException(new RuntimeException(ServerEndpoint.EXCEPTION.getBody())); options.setExpectedHttpRoute( (endpoint, method) -> { diff --git a/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/src/test/java/io/opentelemetry/instrumentation/spring/webflux/v5_3/TestWebfluxSpringBootApp.java b/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/src/test/java/io/opentelemetry/instrumentation/spring/webflux/v5_3/TestWebfluxSpringBootApp.java index 77afcf9881c0..4e1f398e6979 100644 --- a/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/src/test/java/io/opentelemetry/instrumentation/spring/webflux/v5_3/TestWebfluxSpringBootApp.java +++ b/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/src/test/java/io/opentelemetry/instrumentation/spring/webflux/v5_3/TestWebfluxSpringBootApp.java @@ -97,12 +97,12 @@ Mono> error() { } @RequestMapping("/exception") - Flux> exception() throws Exception { + Flux> exception() { return Flux.just( controller( EXCEPTION, () -> { - throw new RuntimeException(EXCEPTION.getBody()); + throw new IllegalStateException(EXCEPTION.getBody()); })); }