Class TraceAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractIterableAssert<TraceAssert,List<io.opentelemetry.sdk.trace.data.SpanData>,io.opentelemetry.sdk.trace.data.SpanData,SpanDataAssert>
io.opentelemetry.sdk.testing.assertj.TraceAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<TraceAssert,,List<io.opentelemetry.sdk.trace.data.SpanData>> org.assertj.core.api.Descriptable<TraceAssert>,org.assertj.core.api.EnumerableAssert<TraceAssert,,io.opentelemetry.sdk.trace.data.SpanData> org.assertj.core.api.ExtensionPoints<TraceAssert,,List<io.opentelemetry.sdk.trace.data.SpanData>> org.assertj.core.api.ObjectEnumerableAssert<TraceAssert,io.opentelemetry.sdk.trace.data.SpanData>
public final class TraceAssert
extends org.assertj.core.api.AbstractIterableAssert<TraceAssert,List<io.opentelemetry.sdk.trace.data.SpanData>,io.opentelemetry.sdk.trace.data.SpanData,SpanDataAssert>
Assertions for an exported trace, a list of
SpanData with the same trace ID.-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractIterableAssert
iterablesFields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals -
Method Summary
Modifier and TypeMethodDescriptionio.opentelemetry.sdk.trace.data.SpanDatagetSpan(int index) Returns the span at theindexwithin the trace.hasSpansSatisfyingExactly(Iterable<? extends Consumer<SpanDataAssert>> assertions) Asserts that the trace under assertion has the same number of spans as providedassertionsand executes eachSpanDataAssertinassertionsin order with the corresponding span.final TraceAsserthasSpansSatisfyingExactly(Consumer<SpanDataAssert>... assertions) Asserts that the trace under assertion has the same number of spans as providedassertionsand executes eachSpanDataAssertinassertionsin order with the corresponding span.hasSpansSatisfyingExactlyInAnyOrder(Iterable<? extends Consumer<SpanDataAssert>> assertions) Asserts that the trace under assertion has the same number of spans as providedassertionsand verifies that there is a combination of spans that satisfies specifiedSpanDataAssertassertionsin the given order.final TraceAsserthasSpansSatisfyingExactlyInAnyOrder(Consumer<SpanDataAssert>... assertions) Asserts that the trace under assertion has the same number of spans as providedassertionsand verifies that there is a combination of spans that satisfies specifiedSpanDataAssertassertionsin the given order.hasTraceId(String traceId) Asserts that the trace has the given trace ID.protected TraceAssertnewAbstractIterableAssert(Iterable<? extends io.opentelemetry.sdk.trace.data.SpanData> iterable) protected SpanDataAssertMethods inherited from class org.assertj.core.api.AbstractIterableAssert
allMatch, allMatch, allSatisfy, allSatisfy, anyMatch, anyMatch, anySatisfy, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, as, as, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsAnyOfForProxy, containsExactly, containsExactlyElementsOf, containsExactlyForProxy, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsExactlyInAnyOrderForProxy, containsForProxy, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyForProxy, containsOnlyNulls, containsOnlyOnce, containsOnlyOnceElementsOf, containsOnlyOnceForProxy, containsSequence, containsSequence, containsSequenceForProxy, containsSubsequence, containsSubsequence, containsSubsequenceForProxy, describedAs, describedAs, doesNotContain, doesNotContainAnyElementsOf, doesNotContainForProxy, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSequenceForProxy, doesNotContainSubsequence, doesNotContainSubsequence, doesNotContainSubsequenceForProxy, doesNotHave, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doesNotHaveSameClassAs, doNotHave, element, element, elements, endsWith, endsWith, endsWithForProxy, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, extractingResultOf, extractingResultOf, filteredOn, filteredOn, filteredOn, filteredOn, filteredOn, filteredOnAssertions, filteredOnAssertions, filteredOnNull, first, first, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtractingForProxy, flatMap, flatMap, flatMap, flatMap, getComparatorsByType, getComparatorsForElementPropertyOrFieldTypes, has, hasAtLeastOneElementOfType, hasExactlyElementsOfTypes, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasOnlyOneElementSatisfying, hasSameClassAs, hasSameElementsAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, hasToString, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, inBinary, inHexadecimal, is, isEmpty, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEmpty, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNullOrEmpty, isOfAnyClassIn, isSameAs, isSubsetOf, isSubsetOf, isSubsetOfForProxy, last, last, map, map, map, navigationDescription, newAbstractIterableAssertForProxy, noneMatch, noneMatch, noneSatisfy, noneSatisfy, overridingErrorMessage, satisfiesExactly, satisfiesExactly, satisfiesExactlyForProxy, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrderForProxy, satisfiesOnlyOnce, satisfiesOnlyOnce, satisfiesOnlyOnceForProxy, singleElement, singleElement, size, startsWith, startsWithForProxy, usingComparator, usingComparator, usingComparatorForElementFieldsWithNames, usingComparatorForElementFieldsWithType, usingComparatorForType, usingComparisonStrategy, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, usingElementComparatorIgnoringFields, usingElementComparatorOnFields, usingFieldByFieldElementComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparatorIgnoringFields, usingRecursiveFieldByFieldElementComparatorOnFields, withFailMessage, withThreadDumpOnError, zipSatisfyMethods inherited from class org.assertj.core.api.AbstractAssert
actual, areEqual, asInstanceOf, asList, assertionError, asString, descriptionText, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, hashCode, hasSameHashCodeAs, hasToString, isElementOfCustomAssert, isInstanceOfSatisfying, isNull, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingEquals, usingEquals, withFailMessage, withRepresentationMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptable
as, describedAs
-
Method Details
-
hasTraceId
Asserts that the trace has the given trace ID. -
hasSpansSatisfyingExactly
@SafeVarargs public final TraceAssert hasSpansSatisfyingExactly(Consumer<SpanDataAssert>... assertions) Asserts that the trace under assertion has the same number of spans as providedassertionsand executes eachSpanDataAssertinassertionsin order with the corresponding span. -
hasSpansSatisfyingExactly
public TraceAssert hasSpansSatisfyingExactly(Iterable<? extends Consumer<SpanDataAssert>> assertions) Asserts that the trace under assertion has the same number of spans as providedassertionsand executes eachSpanDataAssertinassertionsin order with the corresponding span. -
hasSpansSatisfyingExactlyInAnyOrder
@SafeVarargs public final TraceAssert hasSpansSatisfyingExactlyInAnyOrder(Consumer<SpanDataAssert>... assertions) Asserts that the trace under assertion has the same number of spans as providedassertionsand verifies that there is a combination of spans that satisfies specifiedSpanDataAssertassertionsin the given order. This is a variation ofhasSpansSatisfyingExactly(Consumer...)where order does not matter. -
hasSpansSatisfyingExactlyInAnyOrder
public TraceAssert hasSpansSatisfyingExactlyInAnyOrder(Iterable<? extends Consumer<SpanDataAssert>> assertions) Asserts that the trace under assertion has the same number of spans as providedassertionsand verifies that there is a combination of spans that satisfies specifiedSpanDataAssertassertionsin the given order. This is a variation ofhasSpansSatisfyingExactly(Iterable)where order does not matter. -
getSpan
public io.opentelemetry.sdk.trace.data.SpanData getSpan(int index) Returns the span at theindexwithin the trace. This can be useful for asserting the parent of a span. -
toAssert
protected SpanDataAssert toAssert(io.opentelemetry.sdk.trace.data.SpanData value, String description) - Specified by:
toAssertin classorg.assertj.core.api.AbstractIterableAssert<TraceAssert,List<io.opentelemetry.sdk.trace.data.SpanData>, io.opentelemetry.sdk.trace.data.SpanData, SpanDataAssert>
-
newAbstractIterableAssert
protected TraceAssert newAbstractIterableAssert(Iterable<? extends io.opentelemetry.sdk.trace.data.SpanData> iterable) - Specified by:
newAbstractIterableAssertin classorg.assertj.core.api.AbstractIterableAssert<TraceAssert,List<io.opentelemetry.sdk.trace.data.SpanData>, io.opentelemetry.sdk.trace.data.SpanData, SpanDataAssert>
-