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 exportedSpanData
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpanDataAssert
endsAt(long endEpochNanos)
Asserts the span ends at the given epoch timestamp, in nanos.SpanDataAssert
endsAt(long startEpoch, java.util.concurrent.TimeUnit unit)
Asserts the span ends at the given epoch timestamp.SpanDataAssert
endsAt(java.time.Instant timestamp)
Asserts the span ends at the given epoch timestamp.SpanDataAssert
hasAttributes(io.opentelemetry.api.common.Attributes attributes)
Asserts the span has the given attributes.SpanDataAssert
hasAttributesSatisfying(java.util.function.Consumer<io.opentelemetry.api.common.Attributes> attributes)
Asserts the span has attributes satisfying the given condition.SpanDataAssert
hasEnded()
Asserts the span has ended.SpanDataAssert
hasEvents(io.opentelemetry.sdk.trace.data.EventData... events)
Asserts the span has the given events.SpanDataAssert
hasEvents(java.lang.Iterable<io.opentelemetry.sdk.trace.data.EventData> events)
Asserts the span has the given events.SpanDataAssert
hasEventsSatisfying(java.util.function.Consumer<java.util.List<? extends io.opentelemetry.sdk.trace.data.EventData>> condition)
Asserts the span has events satisfying the given condition.SpanDataAssert
hasInstrumentationLibraryInfo(io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo)
Asserts the span has the givenInstrumentationLibraryInfo
.SpanDataAssert
hasKind(io.opentelemetry.api.trace.SpanKind kind)
Asserts the span has the given kind.SpanDataAssert
hasLinks(io.opentelemetry.sdk.trace.data.LinkData... links)
Asserts the span has the given links.SpanDataAssert
hasLinks(java.lang.Iterable<io.opentelemetry.sdk.trace.data.LinkData> links)
Asserts the span has the given links.SpanDataAssert
hasLinksSatisfying(java.util.function.Consumer<java.util.List<? extends io.opentelemetry.sdk.trace.data.LinkData>> condition)
Asserts the span has events satisfying the given condition.SpanDataAssert
hasName(java.lang.String name)
Asserts the span has the given name.SpanDataAssert
hasNotEnded()
Asserts the span has not ended.SpanDataAssert
hasParentSpanId(java.lang.String parentSpanId)
Asserts the span has the given parent span ID.SpanDataAssert
hasResource(io.opentelemetry.sdk.resources.Resource resource)
Asserts the span has the givenResource
.SpanDataAssert
hasSpanId(java.lang.String spanId)
Asserts the span has the given span ID.SpanDataAssert
hasStatus(io.opentelemetry.sdk.trace.data.StatusData status)
Asserts the span has the givenStatusData
.SpanDataAssert
hasTotalAttributeCount(int totalAttributeCount)
Asserts the span has the given total attributes.SpanDataAssert
hasTotalRecordedEvents(int totalRecordedEvents)
Asserts the span has the given total recorded events.SpanDataAssert
hasTotalRecordedLinks(int totalRecordedLinks)
Asserts the span has the given total recorded links.SpanDataAssert
hasTraceId(java.lang.String traceId)
Asserts the span has the given trace ID.SpanDataAssert
hasTraceState(io.opentelemetry.api.trace.TraceState traceState)
Asserts the span has the givenTraceState
.SpanDataAssert
isNotSampled()
Asserts the span is not sampled.SpanDataAssert
isSampled()
Asserts the span is sampled.SpanDataAssert
startsAt(long startEpochNanos)
Asserts the span starts at the given epoch timestamp, in nanos.SpanDataAssert
startsAt(long startEpoch, java.util.concurrent.TimeUnit unit)
Asserts the span starts at the given epoch timestamp.SpanDataAssert
startsAt(java.time.Instant 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, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
-
-
-
Method Detail
-
hasTraceId
public SpanDataAssert hasTraceId(java.lang.String traceId)
Asserts the span has the given trace ID.
-
hasSpanId
public SpanDataAssert hasSpanId(java.lang.String spanId)
Asserts the span has the given span ID.
-
isSampled
public SpanDataAssert isSampled()
Asserts the span is sampled.
-
isNotSampled
public SpanDataAssert isNotSampled()
Asserts the span is not sampled.
-
hasTraceState
public SpanDataAssert hasTraceState(io.opentelemetry.api.trace.TraceState traceState)
Asserts the span has the givenTraceState
.
-
hasParentSpanId
public SpanDataAssert hasParentSpanId(java.lang.String parentSpanId)
Asserts the span has the given parent span ID.
-
hasResource
public SpanDataAssert hasResource(io.opentelemetry.sdk.resources.Resource resource)
Asserts the span has the givenResource
.
-
hasInstrumentationLibraryInfo
public SpanDataAssert hasInstrumentationLibraryInfo(io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo)
Asserts the span has the givenInstrumentationLibraryInfo
.
-
hasName
public SpanDataAssert hasName(java.lang.String name)
Asserts the span has the given name.
-
hasKind
public SpanDataAssert hasKind(io.opentelemetry.api.trace.SpanKind kind)
Asserts the span has the given kind.
-
startsAt
public SpanDataAssert startsAt(long startEpochNanos)
Asserts the span starts at the given epoch timestamp, in nanos.
-
startsAt
public SpanDataAssert startsAt(long startEpoch, java.util.concurrent.TimeUnit unit)
Asserts the span starts at the given epoch timestamp.
-
startsAt
public SpanDataAssert startsAt(java.time.Instant timestamp)
Asserts the span starts at the given epoch timestamp.
-
hasAttributes
public SpanDataAssert hasAttributes(io.opentelemetry.api.common.Attributes attributes)
Asserts the span has the given attributes.
-
hasAttributesSatisfying
public SpanDataAssert hasAttributesSatisfying(java.util.function.Consumer<io.opentelemetry.api.common.Attributes> attributes)
Asserts the span has attributes satisfying the given condition.
-
hasEvents
public SpanDataAssert hasEvents(java.lang.Iterable<io.opentelemetry.sdk.trace.data.EventData> events)
Asserts the span has the given events.
-
hasEvents
public SpanDataAssert hasEvents(io.opentelemetry.sdk.trace.data.EventData... events)
Asserts the span has the given events.
-
hasEventsSatisfying
public SpanDataAssert hasEventsSatisfying(java.util.function.Consumer<java.util.List<? extends io.opentelemetry.sdk.trace.data.EventData>> condition)
Asserts the span has events satisfying the given condition.
-
hasLinks
public SpanDataAssert hasLinks(java.lang.Iterable<io.opentelemetry.sdk.trace.data.LinkData> links)
Asserts the span has the given links.
-
hasLinks
public SpanDataAssert hasLinks(io.opentelemetry.sdk.trace.data.LinkData... links)
Asserts the span has the given links.
-
hasLinksSatisfying
public SpanDataAssert hasLinksSatisfying(java.util.function.Consumer<java.util.List<? extends io.opentelemetry.sdk.trace.data.LinkData>> condition)
Asserts the span has events satisfying the given condition.
-
hasStatus
public SpanDataAssert hasStatus(io.opentelemetry.sdk.trace.data.StatusData status)
Asserts the span has the givenStatusData
.
-
endsAt
public SpanDataAssert endsAt(long endEpochNanos)
Asserts the span ends at the given epoch timestamp, in nanos.
-
endsAt
public SpanDataAssert endsAt(long startEpoch, java.util.concurrent.TimeUnit unit)
Asserts the span ends at the given epoch timestamp.
-
endsAt
public SpanDataAssert endsAt(java.time.Instant timestamp)
Asserts the span ends at the given epoch timestamp.
-
hasEnded
public SpanDataAssert hasEnded()
Asserts the span has ended.
-
hasNotEnded
public SpanDataAssert hasNotEnded()
Asserts the span has not ended.
-
hasTotalRecordedEvents
public SpanDataAssert hasTotalRecordedEvents(int totalRecordedEvents)
Asserts the span has the given total recorded events.
-
hasTotalRecordedLinks
public SpanDataAssert hasTotalRecordedLinks(int totalRecordedLinks)
Asserts the span has the given total recorded links.
-
hasTotalAttributeCount
public SpanDataAssert hasTotalAttributeCount(int totalAttributeCount)
Asserts the span has the given total attributes.
-
-