Class SpanDataAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<SpanDataAssert,io.opentelemetry.sdk.trace.data.SpanData>
io.opentelemetry.sdk.testing.assertj.SpanDataAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<SpanDataAssert,
,io.opentelemetry.sdk.trace.data.SpanData> org.assertj.core.api.Descriptable<SpanDataAssert>
,org.assertj.core.api.ExtensionPoints<SpanDataAssert,
io.opentelemetry.sdk.trace.data.SpanData>
public final class SpanDataAssert
extends org.assertj.core.api.AbstractAssert<SpanDataAssert,io.opentelemetry.sdk.trace.data.SpanData>
Assertions for an exported
SpanData
.-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Method Summary
Modifier and TypeMethodDescriptionendsAt
(long endEpochNanos) Asserts the span ends at the given epoch timestamp, in nanos.Asserts the span ends at the given epoch timestamp.Asserts the span ends at the given epoch timestamp.hasAttributes
(io.opentelemetry.api.common.Attributes attributes) Asserts the span has the given attributes.final SpanDataAssert
hasAttributes
(Map.Entry<? extends io.opentelemetry.api.common.AttributeKey<?>, ?>... entries) Asserts the span has the given attributes.hasAttributesSatisfying
(Consumer<io.opentelemetry.api.common.Attributes> attributes) Asserts the span has attributes satisfying the given condition.hasEnded()
Asserts the span has ended.hasEvents
(io.opentelemetry.sdk.trace.data.EventData... events) Asserts the span has the given events.Asserts the span has the given events.hasEventsSatisfying
(Consumer<List<? extends io.opentelemetry.sdk.trace.data.EventData>> condition) Asserts the span has events satisfying the given condition.final SpanDataAssert
hasEventsSatisfyingExactly
(Consumer<EventDataAssert>... assertions) Asserts that the span under assertion has the same number of events as providedassertions
and executes eachEventDataAssert
inassertions
in order with the corresponding event.hasException
(Throwable exception) Asserts the span has an exception event for the givenThrowable
.hasInstrumentationLibraryInfo
(io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo) Asserts the span has the givenInstrumentationLibraryInfo
.hasKind
(io.opentelemetry.api.trace.SpanKind kind) Asserts the span has the given kind.hasLinks
(io.opentelemetry.sdk.trace.data.LinkData... links) Asserts the span has the given links.Asserts the span has the given links.hasLinksSatisfying
(Consumer<List<? extends io.opentelemetry.sdk.trace.data.LinkData>> condition) Asserts the span has events satisfying the given condition.Asserts the span has the given name.Asserts the span has no parentspan
.Asserts the span has not ended.hasParent
(io.opentelemetry.sdk.trace.data.SpanData parent) Asserts the span has the given parentspan
.hasParentSpanId
(String parentSpanId) Asserts the span has the given parent span ID.hasResource
(io.opentelemetry.sdk.resources.Resource resource) Asserts the span has the givenResource
.Asserts the span has the given span ID.hasStatus
(io.opentelemetry.sdk.trace.data.StatusData status) Asserts the span has the givenStatusData
.hasTotalAttributeCount
(int totalAttributeCount) Asserts the span has the given total attributes.hasTotalRecordedEvents
(int totalRecordedEvents) Asserts the span has the given total recorded events.hasTotalRecordedLinks
(int totalRecordedLinks) Asserts the span has the given total recorded links.hasTraceId
(String traceId) Asserts the span has the given trace ID.hasTraceState
(io.opentelemetry.api.trace.TraceState traceState) Asserts the span has the givenTraceState
.Asserts the span is not sampled.Asserts the span is sampled.startsAt
(long startEpochNanos) Asserts the span starts at the given epoch timestamp, in nanos.Asserts the span starts at the given epoch timestamp.Asserts the span starts at the given epoch timestamp.Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
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, as, as, describedAs
-
Method Details
-
hasTraceId
Asserts the span has the given trace ID. -
hasSpanId
Asserts the span has the given span ID. -
isSampled
Asserts the span is sampled. -
isNotSampled
Asserts the span is not sampled. -
hasTraceState
Asserts the span has the givenTraceState
. -
hasParentSpanId
Asserts the span has the given parent span ID. -
hasParent
Asserts the span has the given parentspan
.Equivalent to
span.hasParentSpanId(parent.getSpanId())
. -
hasNoParent
Asserts the span has no parentspan
.Equivalent to
span.hasParentSpanId(SpanId.getInvalid())
. -
hasResource
Asserts the span has the givenResource
. -
hasInstrumentationLibraryInfo
public SpanDataAssert hasInstrumentationLibraryInfo(io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo) Asserts the span has the givenInstrumentationLibraryInfo
. -
hasName
Asserts the span has the given name. -
hasKind
Asserts the span has the given kind. -
startsAt
Asserts the span starts at the given epoch timestamp, in nanos. -
startsAt
Asserts the span starts at the given epoch timestamp. -
startsAt
Asserts the span starts at the given epoch timestamp. -
hasAttributes
Asserts the span has the given attributes. -
hasAttributes
@SafeVarargs public final SpanDataAssert hasAttributes(Map.Entry<? extends io.opentelemetry.api.common.AttributeKey<?>, ?>... entries) Asserts the span has the given attributes. -
hasAttributesSatisfying
public SpanDataAssert hasAttributesSatisfying(Consumer<io.opentelemetry.api.common.Attributes> attributes) Asserts the span has attributes satisfying the given condition. -
hasException
Asserts the span has an exception event for the givenThrowable
. The stack trace is not matched against. -
hasEvents
Asserts the span has the given events. -
hasEvents
Asserts the span has the given events. -
hasEventsSatisfying
public SpanDataAssert hasEventsSatisfying(Consumer<List<? extends io.opentelemetry.sdk.trace.data.EventData>> condition) Asserts the span has events satisfying the given condition. -
hasEventsSatisfyingExactly
@SafeVarargs public final SpanDataAssert hasEventsSatisfyingExactly(Consumer<EventDataAssert>... assertions) Asserts that the span under assertion has the same number of events as providedassertions
and executes eachEventDataAssert
inassertions
in order with the corresponding event. -
hasLinks
Asserts the span has the given links. -
hasLinks
Asserts the span has the given links. -
hasLinksSatisfying
public SpanDataAssert hasLinksSatisfying(Consumer<List<? extends io.opentelemetry.sdk.trace.data.LinkData>> condition) Asserts the span has events satisfying the given condition. -
hasStatus
Asserts the span has the givenStatusData
. -
endsAt
Asserts the span ends at the given epoch timestamp, in nanos. -
endsAt
Asserts the span ends at the given epoch timestamp. -
endsAt
Asserts the span ends at the given epoch timestamp. -
hasEnded
Asserts the span has ended. -
hasNotEnded
Asserts the span has not ended. -
hasTotalRecordedEvents
Asserts the span has the given total recorded events. -
hasTotalRecordedLinks
Asserts the span has the given total recorded links. -
hasTotalAttributeCount
Asserts the span has the given total attributes.
-