Skip to content

Commit 6e310be

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 d24cf67 commit 6e310be

32 files changed

+2296
-1843
lines changed

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

+17
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

-59
This file was deleted.

0 commit comments

Comments
 (0)