Skip to content

Commit 88d9766

Browse files
committed
spotless
1 parent b6295c4 commit 88d9766

5 files changed

Lines changed: 40 additions & 43 deletions

File tree

instrumentation/spring/spring-webflux/spring-webflux-5.0/testing/src/main/java/io/opentelemetry/instrumentation/spring/webflux/server/AbstractControllerSpringWebFluxServerTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ protected SpanDataAssert assertHandlerSpan(
6060
EXCEPTION_TYPE,
6161
"org.springframework.web.reactive.resource.NoResourceFoundException"),
6262
equalTo(
63-
EXCEPTION_MESSAGE,
64-
"404 NOT_FOUND \"No static resource notFound.\""),
63+
EXCEPTION_MESSAGE, "404 NOT_FOUND \"No static resource notFound.\""),
6564
satisfies(EXCEPTION_STACKTRACE, val -> val.isInstanceOf(String.class))));
6665
} else {
6766
span.hasEventsSatisfyingExactly(

instrumentation/spring/spring-webflux/spring-webflux-5.0/testing/src/main/java/io/opentelemetry/instrumentation/spring/webflux/server/AbstractHandlerSpringWebFluxServerTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ protected SpanDataAssert assertHandlerSpan(
5959
EXCEPTION_TYPE,
6060
"org.springframework.web.reactive.resource.NoResourceFoundException"),
6161
equalTo(
62-
EXCEPTION_MESSAGE,
63-
"404 NOT_FOUND \"No static resource notFound.\""),
62+
EXCEPTION_MESSAGE, "404 NOT_FOUND \"No static resource notFound.\""),
6463
satisfies(EXCEPTION_STACKTRACE, val -> val.isInstanceOf(String.class))));
6564
} else {
6665
span.hasEventsSatisfyingExactly(

instrumentation/spring/spring-webflux/spring-webflux-5.0/testing/src/main/java/io/opentelemetry/instrumentation/spring/webflux/server/AbstractSpringWebFluxServerTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,17 @@ protected void configure(HttpServerTestOptions options) {
8080
}
8181

8282
protected static void assertHandlerExceptionLog(
83-
StringAssertConsumer exceptionTypeAssertion,
84-
StringAssertConsumer exceptionMessageAssertion) {
83+
StringAssertConsumer exceptionTypeAssertion, StringAssertConsumer exceptionMessageAssertion) {
8584
Awaitility.await()
8685
.untilAsserted(
8786
() -> {
8887
List<LogRecordData> logs =
8988
testing.logRecords().stream()
9089
.filter(log -> "exception".equals(log.getEventName()))
91-
.filter(
92-
log ->
93-
INSTRUMENTATION_NAME.equals(
94-
log.getInstrumentationScopeInfo().getName()))
90+
.filter(
91+
log ->
92+
INSTRUMENTATION_NAME.equals(
93+
log.getInstrumentationScopeInfo().getName()))
9594
.collect(toList());
9695

9796
assertThat(logs).hasSize(1);

instrumentation/spring/spring-webflux/spring-webflux-5.0/testing/src/main/java/io/opentelemetry/instrumentation/spring/webflux/server/AbstractSpringWebfluxTest.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
@SuppressWarnings("deprecation") // using deprecated semconv
7171
public abstract class AbstractSpringWebfluxTest {
7272

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";
7474

7575
@RegisterExtension
7676
static final InstrumentationExtension testing = AgentInstrumentationExtension.create();
@@ -411,21 +411,22 @@ void get404Test() {
411411
satisfies(USER_AGENT_ORIGINAL, val -> val.isInstanceOf(String.class)),
412412
equalTo(HTTP_ROUTE, "/**")),
413413
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+
}
429430
}
430431

431432
private static void resource404Exception(EventDataAssert event) {
@@ -454,23 +455,22 @@ private static void resource404Exception(EventDataAssert event) {
454455
}
455456
}
456457

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"));
473472
}
473+
}
474474

475475
@Test
476476
void basicPostTest() {

instrumentation/spring/spring-webflux/spring-webflux-5.3/testing/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/AbstractSpringWebfluxClientInstrumentationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void shouldEndSpanOnMonoTimeout() {
198198
.hasKind(SpanKind.INTERNAL)
199199
.hasNoParent()
200200
.hasStatus(StatusData.error())
201-
.hasException(emitExceptionAsSpanEvents() ? thrown : null),
201+
.hasException(emitExceptionAsSpanEvents() ? thrown : null),
202202
span ->
203203
span.hasName("GET")
204204
.hasKind(CLIENT)

0 commit comments

Comments
 (0)