|
70 | 70 | @SuppressWarnings("deprecation") // using deprecated semconv |
71 | 71 | public abstract class AbstractSpringWebfluxTest { |
72 | 72 |
|
73 | | - private static final String INSTRUMENTATION_NAME = "io.opentelemetry.spring-webflux-5.0"; |
| 73 | + private static final String INSTRUMENTATION_NAME = "io.opentelemetry.spring-webflux-5.0"; |
74 | 74 |
|
75 | 75 | @RegisterExtension |
76 | 76 | static final InstrumentationExtension testing = AgentInstrumentationExtension.create(); |
@@ -411,21 +411,22 @@ void get404Test() { |
411 | 411 | satisfies(USER_AGENT_ORIGINAL, val -> val.isInstanceOf(String.class)), |
412 | 412 | equalTo(HTTP_ROUTE, "/**")), |
413 | 413 | span -> { |
414 | | - span.hasName("ResourceWebHandler.handle") |
415 | | - .hasKind(SpanKind.INTERNAL) |
416 | | - .hasParent(trace.getSpan(0)) |
417 | | - .hasStatus(StatusData.error()); |
418 | | - if (emitExceptionAsSpanEvents()) { |
419 | | - span.hasEventsSatisfyingExactly(AbstractSpringWebfluxTest::resource404Exception); |
420 | | - } |
421 | | - span.hasAttributesSatisfyingExactly( |
422 | | - codeFunctionAssertions( |
423 | | - "org.springframework.web.reactive.resource.ResourceWebHandler", |
424 | | - "handle")); |
425 | | - })); |
426 | | - if (emitExceptionAsLogs()) { |
427 | | - assertResource404ExceptionLog(); |
428 | | - } |
| 414 | + span.hasName("ResourceWebHandler.handle") |
| 415 | + .hasKind(SpanKind.INTERNAL) |
| 416 | + .hasParent(trace.getSpan(0)) |
| 417 | + .hasStatus(StatusData.error()); |
| 418 | + if (emitExceptionAsSpanEvents()) { |
| 419 | + span.hasEventsSatisfyingExactly( |
| 420 | + AbstractSpringWebfluxTest::resource404Exception); |
| 421 | + } |
| 422 | + span.hasAttributesSatisfyingExactly( |
| 423 | + codeFunctionAssertions( |
| 424 | + "org.springframework.web.reactive.resource.ResourceWebHandler", |
| 425 | + "handle")); |
| 426 | + })); |
| 427 | + if (emitExceptionAsLogs()) { |
| 428 | + assertResource404ExceptionLog(); |
| 429 | + } |
429 | 430 | } |
430 | 431 |
|
431 | 432 | private static void resource404Exception(EventDataAssert event) { |
@@ -454,23 +455,22 @@ private static void resource404Exception(EventDataAssert event) { |
454 | 455 | } |
455 | 456 | } |
456 | 457 |
|
457 | | - private static void assertResource404ExceptionLog() { |
458 | | - if (testLatestDeps()) { |
459 | | - assertHandlerExceptionLog( |
460 | | - type -> |
461 | | - type.isEqualTo( |
462 | | - "org.springframework.web.reactive.resource.NoResourceFoundException"), |
463 | | - message -> message.isInstanceOf(String.class)); |
464 | | - } else { |
465 | | - assertHandlerExceptionLog( |
466 | | - type -> |
467 | | - type.isIn( |
468 | | - "org.springframework.web.server.ResponseStatusException", |
469 | | - // Changed in spring 7+ |
470 | | - "org.springframework.web.reactive.resource.NoResourceFoundException"), |
471 | | - message -> message.contains("404")); |
472 | | - } |
| 458 | + private static void assertResource404ExceptionLog() { |
| 459 | + if (testLatestDeps()) { |
| 460 | + assertHandlerExceptionLog( |
| 461 | + type -> |
| 462 | + type.isEqualTo("org.springframework.web.reactive.resource.NoResourceFoundException"), |
| 463 | + message -> message.isInstanceOf(String.class)); |
| 464 | + } else { |
| 465 | + assertHandlerExceptionLog( |
| 466 | + type -> |
| 467 | + type.isIn( |
| 468 | + "org.springframework.web.server.ResponseStatusException", |
| 469 | + // Changed in spring 7+ |
| 470 | + "org.springframework.web.reactive.resource.NoResourceFoundException"), |
| 471 | + message -> message.contains("404")); |
473 | 472 | } |
| 473 | + } |
474 | 474 |
|
475 | 475 | @Test |
476 | 476 | void basicPostTest() { |
|
0 commit comments