File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
exporters/sender/jdk/src/test/java/io/opentelemetry/exporter/sender/jdk/internal Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 2727import java .util .concurrent .TimeUnit ;
2828import javax .net .ssl .SSLException ;
2929import org .assertj .core .api .InstanceOfAssertFactories ;
30+ import org .junit .jupiter .api .AfterEach ;
3031import org .junit .jupiter .api .BeforeEach ;
3132import org .junit .jupiter .api .Test ;
3233import org .junit .jupiter .api .extension .ExtendWith ;
@@ -46,6 +47,8 @@ class JdkHttpSenderTest {
4647
4748 @ BeforeEach
4849 void setup () throws IOException , InterruptedException {
50+ JdkHtttpUtil .setPropagateContextForTestingInDispatcher (true );
51+
4952 // Can't directly spy on HttpClient for some reason, so create a real instance and a mock that
5053 // delegates to the real thing
5154 when (mockHttpClient .send (any (), any ()))
@@ -66,6 +69,11 @@ void setup() throws IOException, InterruptedException {
6669 null );
6770 }
6871
72+ @ AfterEach
73+ void tearDown () {
74+ JdkHtttpUtil .setPropagateContextForTestingInDispatcher (false );
75+ }
76+
6977 @ Test
7078 void sendInternal_RetryableConnectTimeoutException () throws IOException , InterruptedException {
7179 assertThatThrownBy (() -> sender .sendInternal (new NoOpMarshaler ()))
You can’t perform that action at this time.
0 commit comments