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.<T> SpanDataAsserthasAttribute(io.opentelemetry.api.common.AttributeKey<T> key, T value) Asserts the span has the given attribute.hasAttribute(AttributeAssertion attributeAssertion) Asserts the span has an attribute matching theattributeAssertion.hasAttributes(io.opentelemetry.api.common.Attributes attributes) Asserts the span has the given attributes.final SpanDataAsserthasAttributes(Map.Entry<? extends io.opentelemetry.api.common.AttributeKey<?>, ?>... entries) Asserts the span has the given attributes.hasAttributesSatisfying(AttributeAssertion... assertions) Asserts the event has attributes matching allassertions.hasAttributesSatisfying(Iterable<AttributeAssertion> assertions) Asserts the event has attributes matching allassertions.hasAttributesSatisfying(Consumer<io.opentelemetry.api.common.Attributes> attributes) Asserts the span has attributes satisfying the given condition.hasAttributesSatisfyingExactly(AttributeAssertion... assertions) Asserts the span has attributes matching allassertionsand no more.hasAttributesSatisfyingExactly(Iterable<AttributeAssertion> assertions) Asserts the span has attributes matching allassertionsand no more.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 SpanDataAsserthasEventsSatisfyingExactly(Consumer<EventDataAssert>... assertions) Asserts that the span under assertion has the same number of events as providedassertionsand executes eachEventDataAssertinassertionsin 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) Deprecated.hasInstrumentationScopeInfo(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo) Asserts the span has the givenInstrumentationScopeInfo.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.hasStatusSatisfying(Consumer<StatusDataAssert> condition) Asserts the span has a status satisfying the given condition.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
areEqual, 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, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnErrorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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
@Deprecated public SpanDataAssert hasInstrumentationLibraryInfo(io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo) Deprecated.Asserts the span has the givenInstrumentationLibraryInfo. -
hasInstrumentationScopeInfo
public SpanDataAssert hasInstrumentationScopeInfo(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo) Asserts the span has the givenInstrumentationScopeInfo. -
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. -
hasAttribute
Asserts the span has the given attribute. -
hasAttribute
Asserts the span has an attribute matching theattributeAssertion. -
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. -
hasAttributesSatisfying
Asserts the event has attributes matching allassertions. Assertions can be created using methods likeOpenTelemetryAssertions.satisfies(AttributeKey, OpenTelemetryAssertions.LongAssertConsumer).- Since:
- 1.21.0
-
hasAttributesSatisfying
Asserts the event has attributes matching allassertions. Assertions can be created using methods likeOpenTelemetryAssertions.satisfies(AttributeKey, OpenTelemetryAssertions.LongAssertConsumer).- Since:
- 1.21.0
-
hasAttributesSatisfyingExactly
Asserts the span has attributes matching allassertionsand no more. Assertions can be created using methods likeOpenTelemetryAssertions.satisfies(AttributeKey, OpenTelemetryAssertions.LongAssertConsumer). -
hasAttributesSatisfyingExactly
Asserts the span has attributes matching allassertionsand no more. Assertions can be created using methods likeOpenTelemetryAssertions.satisfies(AttributeKey, OpenTelemetryAssertions.LongAssertConsumer). -
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 providedassertionsand executes eachEventDataAssertinassertionsin 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.- Since:
- 1.16.0
-
hasStatusSatisfying
Asserts the span has a status satisfying the given condition. -
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.
-
hasInstrumentationScopeInfo(InstrumentationScopeInfo).