Skip to content

Commit fd2b93b

Browse files
committed
refactor
1 parent d424be3 commit fd2b93b

File tree

2 files changed

+12
-2
lines changed
  • instrumentation/spring/spring-webmvc

2 files changed

+12
-2
lines changed

instrumentation/spring/spring-webmvc/spring-webmvc-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/webmvc/v3_1/boot/SpringBootBasedTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,9 @@ protected void configure(HttpServerTestOptions options) {
5959
Boolean.getBoolean("testLatestDeps") ? 500 : 200);
6060
options.setExpectedException(new RuntimeException(EXCEPTION.getBody()));
6161
}
62+
63+
@Override
64+
protected boolean shouldTestDeferredResult() {
65+
return Boolean.getBoolean("testLatestDeps");
66+
}
6267
}

instrumentation/spring/spring-webmvc/spring-webmvc-common/testing/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/boot/AbstractSpringBootBasedTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import static io.opentelemetry.semconv.ExceptionAttributes.EXCEPTION_STACKTRACE;
2424
import static io.opentelemetry.semconv.ExceptionAttributes.EXCEPTION_TYPE;
2525
import static org.assertj.core.api.Assertions.assertThat;
26+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2627

2728
import io.opentelemetry.api.common.AttributeKey;
2829
import io.opentelemetry.api.trace.SpanKind;
@@ -42,7 +43,6 @@
4243
import java.util.Locale;
4344
import java.util.function.Consumer;
4445
import org.junit.jupiter.api.Test;
45-
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
4646
import org.junit.jupiter.params.ParameterizedTest;
4747
import org.junit.jupiter.params.provider.ValueSource;
4848
import org.springframework.context.ConfigurableApplicationContext;
@@ -60,6 +60,10 @@ public abstract class AbstractSpringBootBasedTest
6060

6161
protected abstract Class<?> securityConfigClass();
6262

63+
protected boolean shouldTestDeferredResult() {
64+
return true;
65+
}
66+
6367
@Override
6468
protected void stopServer(ConfigurableApplicationContext ctx) {
6569
ctx.close();
@@ -147,8 +151,9 @@ void testCharacterEncodingOfTestPassword(String testPassword) {
147151
}
148152

149153
@Test
150-
@EnabledIfSystemProperty(named = "testLatestDeps", matches = "true")
151154
void deferredResult() {
155+
assumeTrue(shouldTestDeferredResult());
156+
152157
AggregatedHttpResponse response =
153158
client.execute(request(DEFERRED_RESULT, "GET")).aggregate().join();
154159

0 commit comments

Comments
 (0)