Skip to content

Commit

Permalink
init rxjava3 junit test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kaibocai7 committed Mar 11, 2023
1 parent 468aa9e commit e84d780
Show file tree
Hide file tree
Showing 32 changed files with 2,296 additions and 1,843 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

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

@Test
void basicFluxIterable() {
List<Integer> result =
testing.runWithSpan(
"parent",
() -> Flux.fromIterable(Ints.asList(5, 6)).map(this::addOne).collectList().block());
assertThat(result).containsExactly(6, 7);

testing.waitAndAssertTraces(
trace ->
trace.hasSpansSatisfyingExactly(
span -> span.hasName("parent").hasNoParent(),
span -> span.hasName("add one").hasParent(trace.getSpan(0)),
span -> span.hasName("add one").hasParent(trace.getSpan(0))));
}

@Test
void twoOperationsFlux() {
List<Integer> result =
Expand Down

This file was deleted.

Loading

0 comments on commit e84d780

Please sign in to comment.