Skip to content

Commit e84d780

Browse files
committed
init rxjava3 junit test
update testing logics for rxjava update test instance level migrate rxjava3 unit tests to java sort traces for test - format code style migrate rest of tests for rxjava3 format code style
1 parent 468aa9e commit e84d780

32 files changed

+2296
-1843
lines changed

instrumentation/reactor/reactor-3.1/testing/src/main/java/io/opentelemetry/instrumentation/reactor/AbstractReactorCoreTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import static org.assertj.core.api.Assertions.assertThat;
1010
import static org.assertj.core.api.Assertions.assertThatThrownBy;
1111

12+
import com.google.common.primitives.Ints;
1213
import io.opentelemetry.api.trace.Span;
1314
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
1415
import io.opentelemetry.sdk.testing.assertj.TraceAssert;
@@ -115,6 +116,22 @@ void basicFlux() {
115116
span -> span.hasName("add one").hasParent(trace.getSpan(0))));
116117
}
117118

119+
@Test
120+
void basicFluxIterable() {
121+
List<Integer> result =
122+
testing.runWithSpan(
123+
"parent",
124+
() -> Flux.fromIterable(Ints.asList(5, 6)).map(this::addOne).collectList().block());
125+
assertThat(result).containsExactly(6, 7);
126+
127+
testing.waitAndAssertTraces(
128+
trace ->
129+
trace.hasSpansSatisfyingExactly(
130+
span -> span.hasName("parent").hasNoParent(),
131+
span -> span.hasName("add one").hasParent(trace.getSpan(0)),
132+
span -> span.hasName("add one").hasParent(trace.getSpan(0))));
133+
}
134+
118135
@Test
119136
void twoOperationsFlux() {
120137
List<Integer> result =

instrumentation/rxjava/rxjava-3-common/testing/src/main/groovy/io/opentelemetry/instrumentation/rxjava/v3/common/AbstractRxJava3SubscriptionTest.groovy

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)