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

    iterables

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Method Summary

    Modifier and Type
    Method
    Description
    io.opentelemetry.sdk.trace.data.SpanData
    getSpan(int index)
    Returns the span at the index within the trace.
    Asserts that the trace under assertion has the same number of spans as provided assertions and executes each SpanDataAssert in assertions in order with the corresponding span.
    Asserts that the trace under assertion has the same number of spans as provided assertions and executes each SpanDataAssert in assertions in order with the corresponding span.
    hasTraceId(String traceId)
    Asserts that the trace has the given trace ID.
    protected TraceAssert
    newAbstractIterableAssert(Iterable<? extends io.opentelemetry.sdk.trace.data.SpanData> iterable)
     
    protected SpanDataAssert
    toAssert(io.opentelemetry.sdk.trace.data.SpanData value, String description)
     

    Methods inherited from class org.assertj.core.api.AbstractIterableAssert

    allMatch, allMatch, allSatisfy, allSatisfy, 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, noneSatisfy, noneSatisfy, overridingErrorMessage, satisfiesExactly, satisfiesExactly, satisfiesExactlyForProxy, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrderForProxy, singleElement, singleElement, size, startsWith, startsWithForProxy, usingComparator, usingComparator, usingComparatorForElementFieldsWithNames, usingComparatorForElementFieldsWithType, usingComparatorForType, usingComparisonStrategy, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, usingElementComparatorIgnoringFields, usingElementComparatorOnFields, usingFieldByFieldElementComparator, usingRecursiveComparison, usingRecursiveComparison, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparatorIgnoringFields, usingRecursiveFieldByFieldElementComparatorOnFields, withFailMessage, withThreadDumpOnError, zipSatisfy

    Methods inherited from class org.assertj.core.api.AbstractAssert

    asInstanceOf, asList, assertionError, asString, descriptionText, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, hashCode, hasSameHashCodeAs, isElementOfCustomAssert, isInstanceOfSatisfying, isNull, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, withFailMessage, withRepresentation

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as
  • Method Details

    • hasTraceId

      public TraceAssert hasTraceId(String traceId)
      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 provided assertions and executes each SpanDataAssert in assertions in 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 provided assertions and executes each SpanDataAssert in assertions in order with the corresponding span.
    • getSpan

      public io.opentelemetry.sdk.trace.data.SpanData getSpan(int index)
      Returns the span at the index within 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:
      toAssert in class org.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:
      newAbstractIterableAssert in class org.assertj.core.api.AbstractIterableAssert<TraceAssert,List<io.opentelemetry.sdk.trace.data.SpanData>,io.opentelemetry.sdk.trace.data.SpanData,SpanDataAssert>