Skip to content

Commit e07f971

Browse files
committed
cleanup
1 parent 03a6fd2 commit e07f971

File tree

1 file changed

+18
-25
lines changed
  • instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/properties

1 file changed

+18
-25
lines changed

instrumentation/spring/spring-boot-autoconfigure/src/test/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/properties/SpringConfigPropertiesTest.java

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,36 +90,29 @@ void mapObjectHeaders(String key) {
9090
}
9191

9292
public static Stream<Arguments> listProperties() {
93-
return Arrays.stream(
94-
new String[] {
95-
"otel.experimental.metrics.view.config",
96-
"otel.experimental.resource.disabled.keys",
97-
"otel.propagators",
98-
"otel.logs.exporter",
99-
"otel.metrics.exporter",
100-
"otel.traces.exporter",
101-
"otel.instrumentation.http.client.capture-request-headers",
102-
"otel.instrumentation.http.client.capture-response-headers",
103-
"otel.instrumentation.http.server.capture-request-headers",
104-
"otel.instrumentation.http.server.capture-response-headers",
105-
"otel.instrumentation.http.known-methods",
106-
})
107-
.map(Arguments::of);
93+
return Stream.of(
94+
Arguments.of("otel.experimental.metrics.view.config", Arrays.asList("a", "b")),
95+
Arguments.of("otel.experimental.resource.disabled.keys", Arrays.asList("a", "b")),
96+
Arguments.of("otel.propagators", Arrays.asList("baggage", "b3")),
97+
Arguments.of("otel.logs.exporter", Collections.singletonList("console")),
98+
Arguments.of("otel.metrics.exporter", Collections.singletonList("console")),
99+
Arguments.of("otel.traces.exporter", Collections.singletonList("console")),
100+
Arguments.of(
101+
"otel.instrumentation.http.client.capture-request-headers", Arrays.asList("a", "b")),
102+
Arguments.of(
103+
"otel.instrumentation.http.client.capture-response-headers", Arrays.asList("a", "b")),
104+
Arguments.of(
105+
"otel.instrumentation.http.server.capture-request-headers", Arrays.asList("a", "b")),
106+
Arguments.of(
107+
"otel.instrumentation.http.server.capture-response-headers", Arrays.asList("a", "b")),
108+
Arguments.of("otel.instrumentation.http.known-methods", Arrays.asList("a", "b")));
108109
}
109110

110111
@ParameterizedTest
111112
@MethodSource("listProperties")
112113
@DisplayName("should map list from application.yaml list")
113-
void listsShouldWorkWithYaml(String key) {
114-
List<String> expected;
115-
if (key.equals("otel.propagators")) {
116-
expected = Arrays.asList("baggage", "b3");
117-
} else if (key.endsWith(".exporter")) {
118-
expected = Collections.singletonList("console");
119-
} else {
120-
expected = Arrays.asList("a", "b");
121-
}
122-
114+
// See the application.yaml file
115+
void listsShouldWorkWithYaml(String key, List<String> expected) {
123116
new ApplicationContextRunner()
124117
.withConfiguration(AutoConfigurations.of(OpenTelemetryAutoConfiguration.class))
125118
.withInitializer(new ConfigDataApplicationContextInitializer())

0 commit comments

Comments
 (0)