File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
smoke-tests-otel-starter/spring-smoke-testing/src/main/java/io/opentelemetry/spring/smoketest Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 8
8
import static org .assertj .core .api .Assertions .assertThat ;
9
9
10
10
import io .opentelemetry .api .OpenTelemetry ;
11
+ import java .util .Arrays ;
12
+ import java .util .List ;
11
13
import org .junit .jupiter .api .AfterEach ;
12
14
import org .junit .jupiter .api .BeforeAll ;
13
15
import org .junit .jupiter .api .BeforeEach ;
19
21
@ ExtendWith (OutputCaptureExtension .class )
20
22
public abstract class AbstractSpringStarterSmokeTest {
21
23
24
+ private static final List <String > IGNORED_WARNINGS =
25
+ Arrays .asList (
26
+ "Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider" ,
27
+ "The architecture 'amd64' for image" );
28
+
22
29
@ Autowired protected OpenTelemetry openTelemetry ;
23
30
24
31
protected SpringSmokeTestRunner testing ;
@@ -47,11 +54,10 @@ void checkSpringLogs(CapturedOutput output) {
47
54
// only look for WARN and ERROR log level, e.g. [Test worker] WARN
48
55
.satisfies (
49
56
s -> {
50
- if (!s .toString ()
51
- .contains (
52
- "Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider" )
53
- && !s .toString ().contains ("The architecture 'amd64' for image" )) {
54
- assertThat (s ).doesNotContain ("] WARN" ).doesNotContain ("] ERROR" );
57
+ for (String line : s .toString ().split ("\n " )) {
58
+ if (IGNORED_WARNINGS .stream ().noneMatch (line ::contains )) {
59
+ assertThat (line ).doesNotContain ("] WARN" ).doesNotContain ("] ERROR" );
60
+ }
55
61
}
56
62
});
57
63
}
You can’t perform that action at this time.
0 commit comments