diff --git a/smoke-tests-otel-starter/spring-smoke-testing/src/main/java/io/opentelemetry/spring/smoketest/AbstractSpringStarterSmokeTest.java b/smoke-tests-otel-starter/spring-smoke-testing/src/main/java/io/opentelemetry/spring/smoketest/AbstractSpringStarterSmokeTest.java index e7269737d6c7..d762c78de4d4 100644 --- a/smoke-tests-otel-starter/spring-smoke-testing/src/main/java/io/opentelemetry/spring/smoketest/AbstractSpringStarterSmokeTest.java +++ b/smoke-tests-otel-starter/spring-smoke-testing/src/main/java/io/opentelemetry/spring/smoketest/AbstractSpringStarterSmokeTest.java @@ -8,6 +8,8 @@ import static org.assertj.core.api.Assertions.assertThat; import io.opentelemetry.api.OpenTelemetry; +import java.util.Arrays; +import java.util.List; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -19,6 +21,11 @@ @ExtendWith(OutputCaptureExtension.class) public abstract class AbstractSpringStarterSmokeTest { + private static final List IGNORED_WARNINGS = + Arrays.asList( + "Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider", + "The architecture 'amd64' for image"); + @Autowired protected OpenTelemetry openTelemetry; protected SpringSmokeTestRunner testing; @@ -47,11 +54,10 @@ void checkSpringLogs(CapturedOutput output) { // only look for WARN and ERROR log level, e.g. [Test worker] WARN .satisfies( s -> { - if (!s.toString() - .contains( - "Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider") - && !s.toString().contains("The architecture 'amd64' for image")) { - assertThat(s).doesNotContain("] WARN").doesNotContain("] ERROR"); + for (String line : s.toString().split("\n")) { + if (IGNORED_WARNINGS.stream().noneMatch(line::contains)) { + assertThat(line).doesNotContain("] WARN").doesNotContain("] ERROR"); + } } }); }