Class SpanAssert<SELF extends SpanAssert<SELF>>

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,io.micrometer.tracing.exporter.FinishedSpan>
io.micrometer.tracing.test.simple.SpanAssert<SELF>
All Implemented Interfaces:
org.assertj.core.api.Assert<SELF,io.micrometer.tracing.exporter.FinishedSpan>, org.assertj.core.api.Descriptable<SELF>, org.assertj.core.api.ExtensionPoints<SELF,io.micrometer.tracing.exporter.FinishedSpan>
Direct Known Subclasses:
SpansAssert.SpansAssertReturningAssert

public class SpanAssert<SELF extends SpanAssert<SELF>> extends org.assertj.core.api.AbstractAssert<SELF,io.micrometer.tracing.exporter.FinishedSpan>
Assertion methods for SimpleSpans.

To create a new instance of this class, invoke assertThat(FinishedSpan) or then(FinishedSpan).

Since:
1.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Syntactic sugar that extends AbstractThrowableAssert methods with an option to go back to SpanAssert.
  • Field Summary

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

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

    Constructors
    Modifier
    Constructor
    Description
    protected
    SpanAssert(io.micrometer.tracing.exporter.FinishedSpan actual)
    Creates a new instance of SpanAssert.
  • Method Summary

    Modifier and Type
    Method
    Description
    static SpanAssert
    assertThat(io.micrometer.tracing.exporter.FinishedSpan actual)
    Creates the assert object for FinishedSpan.
    Syntactic sugar to assert a throwable on a FinishedSpan.getError().
    Verifies that this span does not have an event with a given name.
    Verifies that this span does not have ip equal to the given value.
    doesNotHaveKindEqualTo(io.micrometer.tracing.Span.Kind kind)
    Verifies that this span doesn't have span kind equal to the given value.
    doesNotHaveLink(io.micrometer.tracing.Link link)
    Verifies that this span does not have a link.
    doesNotHaveLink(Consumer<io.micrometer.tracing.Link> consumer)
    Verifies that this span has no links that passes the assertion function.
    Verifies that this span does not have name equal to the given value
    Verifies that this span doesn't have port equal to the given value.
    Verifies that this span does not have remote service name equal to the given value.
    Verifies that this span doesn't have span id equal to the given value.
    doesNotHaveTag(io.micrometer.common.docs.KeyName key, String value)
    Verifies that this span does not have a tag with key and value.
    Verifies that this span does not have a tag with key and value.
    doesNotHaveTagWithKey(io.micrometer.common.docs.KeyName key)
    Verifies that this span does not have a tag with key.
    Verifies that this span does not have a tag with key.
    Verifies that this span doesn't have trace id equal to the given value.
    Verifies that this span has an event with a given name.
    Verifies that this span has ip equal to the given value.
    Verifies that this span has ip set.
    Verifies that this span has ip set.
    hasKindEqualTo(io.micrometer.tracing.Span.Kind kind)
    Verifies that this span has span kind equal to the given value.
    hasLink(io.micrometer.tracing.Link link)
    Verifies that this span has a link.
    hasLink(Consumer<io.micrometer.tracing.Link> consumer)
    Verifies that this span has at least one link that passes the assertion function.
    Verifies that this span has name equal to the given value
    Verifies that this span has no tags.
    hasPortEqualTo(int port)
    Verifies that this span has port equal to the given value.
    Verifies that this span doesn't have a port set.
    Verifies that this span has a port set.
    Verifies that this span has remote service name equal to the given value.
    Verifies that this span has span id equal to the given value.
    hasTag(io.micrometer.common.docs.KeyName key, String value)
    Verifies that this span has a tag with key and value.
    hasTag(String key, String value)
    Verifies that this span has a tag with key and value.
    hasTagWithKey(io.micrometer.common.docs.KeyName key)
    Verifies that this span has a tag with key.
    Verifies that this span has a tag with key.
    Verifies that this span has trace id equal to the given value.
    Verifies that this span is ended.
    Verifies that this span is not ended.
    Verifies that this span is not started.
    Verifies that this span is started.
    static SpanAssert
    then(io.micrometer.tracing.exporter.FinishedSpan actual)
    Creates the assert object for FinishedSpan.
    Syntactic sugar to assert a throwable on a FinishedSpan.getError().

    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, usingRecursiveAssertion, usingRecursiveAssertion, 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
  • Constructor Details

    • SpanAssert

      protected SpanAssert(io.micrometer.tracing.exporter.FinishedSpan actual)
      Creates a new instance of SpanAssert.
      Parameters:
      actual - actual object to assert
  • Method Details

    • assertThat

      public static SpanAssert assertThat(io.micrometer.tracing.exporter.FinishedSpan actual)
      Creates the assert object for FinishedSpan.
      Parameters:
      actual - span to assert against
      Returns:
      span assertions
    • then

      public static SpanAssert then(io.micrometer.tracing.exporter.FinishedSpan actual)
      Creates the assert object for FinishedSpan.
      Parameters:
      actual - span to assert against
      Returns:
      span assertions
    • hasNoTags

      public SELF hasNoTags()
      Verifies that this span has no tags.

      Examples:

       // assertions succeed
       assertThat(finishedSpan).hasNoTags();
      
       // assertions fail
       assertThat(finishedSpanWithTags).hasNoTags();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has tags.
      Since:
      1.0.0
    • hasTagWithKey

      public SELF hasTagWithKey(String key)
      Verifies that this span has a tag with key.

      Examples:

       // assertions succeed
       assertThat(finishedSpanWithTagFoo).hasTagWithKey("foo");
      
       // assertions fail
       assertThat(finishedSpanWithNoTags).hasTagWithKey("foo");
      Parameters:
      key - tag key name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span doesn't have a tag with given key.
      Since:
      1.0.0
    • hasTagWithKey

      public SELF hasTagWithKey(io.micrometer.common.docs.KeyName key)
      Verifies that this span has a tag with key.

      Examples:

       // assertions succeed
       assertThat(finishedSpanWithTagFoo).hasTagWithKey("foo");
      
       // assertions fail
       assertThat(finishedSpanWithNoTags).hasTagWithKey("foo");
      Parameters:
      key - tag key name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span doesn't have a tag with given key.
      Since:
      1.0.0
    • hasTag

      public SELF hasTag(String key, String value)
      Verifies that this span has a tag with key and value.

      Examples:

       // assertions succeed
       assertThat(finishedSpanWithTag).hasTag("tagKey", "tagValue");
      
       // assertions fail
       assertThat(finishedSpanWithNoTags).hasTag("tagKey", "tagValue");
      Parameters:
      key - tag key name
      value - tag value
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span doesn't have a tag with given key and value.
      Since:
      1.0.0
    • hasTag

      public SELF hasTag(io.micrometer.common.docs.KeyName key, String value)
      Verifies that this span has a tag with key and value.

      Examples:

       // assertions succeed
       assertThat(finishedSpanWithTag).hasTag("tagKey", "tagValue");
      
       // assertions fail
       assertThat(finishedSpanWithNoTags).hasTag("tagKey", "tagValue");
      Parameters:
      key - tag key name
      value - tag value
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span doesn't have a tag with given key and value.
      Since:
      1.0.0
    • doesNotHaveTagWithKey

      public SELF doesNotHaveTagWithKey(String key)
      Verifies that this span does not have a tag with key.

      Examples:

       // assertions succeed
       assertThat(finishedSpanWithNoTags).doesNotHaveTagWithKey("foo");
      
       // assertions fail
       assertThat(finishedSpanWithFooTag).doesNotHaveTagWithKey("foo");
      Parameters:
      key - tag key name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has a tag with given key.
      Since:
      1.0.0
    • doesNotHaveTagWithKey

      public SELF doesNotHaveTagWithKey(io.micrometer.common.docs.KeyName key)
      Verifies that this span does not have a tag with key.

      Examples:

       // assertions succeed
       assertThat(finishedSpanWithNoTags).doesNotHaveTagWithKey("foo");
      
       // assertions fail
       assertThat(finishedSpanWithFooTag).doesNotHaveTagWithKey("foo");
      Parameters:
      key - tag key name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has a tag with given key.
      Since:
      1.0.0
    • doesNotHaveTag

      public SELF doesNotHaveTag(String key, String value)
      Verifies that this span does not have a tag with key and value.

      Examples:

       // assertions succeed
       assertThat(finishedSpanWithNoTags).doesNotHaveTag("tagKey", "tagValue");
      
       // assertions fail
       assertThat(finishedSpanWithFooTag).doesNotHaveTag("foo", "tagValue");
      Parameters:
      key - tag key name
      value - tag value
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has a tag with given key and value.
      Since:
      1.0.0
    • doesNotHaveTag

      public SELF doesNotHaveTag(io.micrometer.common.docs.KeyName key, String value)
      Verifies that this span does not have a tag with key and value.

      Examples:

       // assertions succeed
       assertThat(finishedSpanWithNoTags).doesNotHaveTag("tagKey", "tagValue");
      
       // assertions fail
       assertThat(finishedSpanWithFooTag).doesNotHaveTag("foo", "tagValue");
      Parameters:
      key - tag key name
      value - tag value
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has a tag with given key and value.
      Since:
      1.0.0
    • isStarted

      public SELF isStarted()
      Verifies that this span is started.

      Examples:

       // assertions succeed
       assertThat(startedSpan).isStarted();
      
       // assertions fail
       assertThat(notStartedSpan).isStarted();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has not been started
      Since:
      1.0.0
    • isNotStarted

      public SELF isNotStarted()
      Verifies that this span is not started.

      Examples:

       // assertions succeed
       assertThat(notStartedSpan).isNotStarted();
      
       // assertions fail
       assertThat(startedSpan).isNotStarted();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has been started
      Since:
      1.0.0
    • isEnded

      public SELF isEnded()
      Verifies that this span is ended.

      Examples:

       // assertions succeed
       assertThat(endedSpan).isEnded();
      
       // assertions fail
       assertThat(notEndedSpan).isEnded();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has not been ended
      Since:
      1.0.0
    • isNotEnded

      public SELF isNotEnded()
      Verifies that this span is not ended.

      Examples:

       // assertions succeed
       assertThat(notEndedSpan).isNotEnded();
      
       // assertions fail
       assertThat(endedSpan).isNotEnded();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has been ended
      Since:
      1.0.0
    • assertThatThrowable

      public SpanAssert.SpanAssertReturningAssert assertThatThrowable()
      Syntactic sugar to assert a throwable on a FinishedSpan.getError().
      Returns:
      SpanAssert.SpanAssertReturningAssert
    • thenThrowable

      public SpanAssert.SpanAssertReturningAssert thenThrowable()
      Syntactic sugar to assert a throwable on a FinishedSpan.getError().
      Returns:
      SpanAssert.SpanAssertReturningAssert
    • hasRemoteServiceNameEqualTo

      public SELF hasRemoteServiceNameEqualTo(String remoteServiceName)
      Verifies that this span has remote service name equal to the given value.

      Examples:

       // assertions succeed
       assertThat(remoteServiceNameContainingSpan).hasRemoteServiceNameEqualTo("foo");
      
       // assertions fail
       assertThat(remoteServiceNameMissingSpan).hasRemoteServiceNameEqualTo("foo");
      Parameters:
      remoteServiceName - remote service name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span does not have remote service name equal to the given value
      Since:
      1.0.0
    • doesNotHaveRemoteServiceNameEqualTo

      public SELF doesNotHaveRemoteServiceNameEqualTo(String remoteServiceName)
      Verifies that this span does not have remote service name equal to the given value.

      Examples:

       // assertions succeed
       assertThat(remoteServiceNameMissingSpan).doesNotHaveRemoteServiceNameEqualTo("foo");
      
       // assertions fail
       assertThat(remoteServiceNameContainingSpan).doesNotHaveRemoteServiceNameEqualTo("foo");
      Parameters:
      remoteServiceName - remote service name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span does has remote service name equal to the given value
      Since:
      1.0.0
    • hasKindEqualTo

      public SELF hasKindEqualTo(io.micrometer.tracing.Span.Kind kind)
      Verifies that this span has span kind equal to the given value.

      Examples:

       // assertions succeed
       assertThat(clientSpan).hasKindEqualTo(Span.Kind.CLIENT);
      
       // assertions fail
       assertThat(serverSpan).hasKindEqualTo(Span.Kind.SERVER);
      Parameters:
      kind - span kind
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span does not have span kind equal to the given value
      Since:
      1.0.0
    • doesNotHaveKindEqualTo

      public SELF doesNotHaveKindEqualTo(io.micrometer.tracing.Span.Kind kind)
      Verifies that this span doesn't have span kind equal to the given value.

      Examples:

       // assertions succeed
       assertThat(serverSpan).doesNotHaveKindEqualTo(Span.Kind.CLIENT);
      
       // assertions fail
       assertThat(clientSpan).doesNotHaveKindEqualTo(Span.Kind.SERVER);
      Parameters:
      kind - span kind
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has span kind equal to the given value
      Since:
      1.0.0
    • hasEventWithNameEqualTo

      public SELF hasEventWithNameEqualTo(String eventName)
      Verifies that this span has an event with a given name.

      Examples:

       // assertions succeed
       assertThat(spanWithEventFoo).hasEventWithNameEqualTo("foo");
      
       // assertions fail
       assertThat(spanWithNoEvents).hasEventWithNameEqualTo("foo");
      Parameters:
      eventName - name of the event
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span does not have span kind equal to the given value
      Since:
      1.0.0
    • doesNotHaveEventWithNameEqualTo

      public SELF doesNotHaveEventWithNameEqualTo(String eventName)
      Verifies that this span does not have an event with a given name.

      Examples:

       // assertions succeed
       assertThat(spanWithNoEvents).doesNotHaveEventWithNameEqualTo("foo");
      
       // assertions fail
       assertThat(spanWithEventFoo).doesNotHaveEventWithNameEqualTo("foo");
      Parameters:
      eventName - name of the event
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has span kind equal to the given value
      Since:
      1.0.0
    • hasNameEqualTo

      public SELF hasNameEqualTo(String spanName)
      Verifies that this span has name equal to the given value

      Examples:

       // assertions succeed
       assertThat(spanNamedFoo).hasNameEqualTo("foo");
      
       // assertions fail
       assertThat(spanNamedBar).hasNameEqualTo("foo");
      Parameters:
      spanName - span name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span does not have name equal to the given value
      Since:
      1.0.0
    • doesNotHaveNameEqualTo

      public SELF doesNotHaveNameEqualTo(String spanName)
      Verifies that this span does not have name equal to the given value

      Examples:

       // assertions succeed
       assertThat(spanNamedFoo).doesNotHaveNameEqualTo("bar");
      
       // assertions fail
       assertThat(spanNamedBar).doesNotHaveNameEqualTo("bar");
      Parameters:
      spanName - span name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span does not have name equal to the given value
      Since:
      1.0.0
    • hasIpEqualTo

      public SELF hasIpEqualTo(String ip)
      Verifies that this span has ip equal to the given value.

      Examples:

       // assertions succeed
       assertThat(spanWithIpLocalhost).hasIpEqualTo("127.0.0.1");
      
       // assertions fail
       assertThat(spanWithNoIp).hasIpEqualTo("127.0.0.1");
      Parameters:
      ip - ip
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span does not have ip equal to the given value
      Since:
      1.0.0
    • doesNotHaveIpEqualTo

      public SELF doesNotHaveIpEqualTo(String ip)
      Verifies that this span does not have ip equal to the given value.

      Examples:

       // assertions succeed
       assertThat(spanWithNoIp).doesNotHaveIpEqualTo("127.0.0.1");
      
       // assertions fail
       assertThat(spanWithIpLocalhost).doesNotHaveIpEqualTo("127.0.0.1");
      Parameters:
      ip - ip
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has ip equal to the given value
      Since:
      1.0.0
    • hasIpThatIsNotBlank

      public SELF hasIpThatIsNotBlank()
      Verifies that this span has ip set.

      Examples:

       // assertions succeed
       assertThat(spanWithIpLocalhost).hasIpThatIsNotBlank();
      
       // assertions fail
       assertThat(spanWithNoIp).hasIpThatIsNotBlank();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span does not have ip set
      Since:
      1.0.0
    • hasIpThatIsBlank

      public SELF hasIpThatIsBlank()
      Verifies that this span has ip set.

      Examples:

       // assertions succeed
       assertThat(spanWithNoIp).hasIpThatIsBlank();
      
       // assertions fail
       assertThat(spanWithIpLocalhost).hasIpThatIsBlank();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span does not have ip set
      Since:
      1.0.0
    • hasPortEqualTo

      public SELF hasPortEqualTo(int port)
      Verifies that this span has port equal to the given value.

      Examples:

       // assertions succeed
       assertThat(spanWithPort80).hasPortEqualTo(80);
      
       // assertions fail
       assertThat(spanWithPort80).hasPortEqualTo(7777);
      Parameters:
      port - port
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has port equal to the given value
      Since:
      1.0.0
    • doesNotHavePortEqualTo

      public SELF doesNotHavePortEqualTo(int port)
      Verifies that this span doesn't have port equal to the given value.

      Examples:

       // assertions succeed
       assertThat(spanWithPort80).doesNotHavePortEqualTo(7777);
      
       // assertions fail
       assertThat(spanWithPort80).doesNotHavePortEqualTo(80);
      Parameters:
      port - port
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has port equal to the given value
      Since:
      1.0.0
    • hasPortThatIsNotSet

      public SELF hasPortThatIsNotSet()
      Verifies that this span doesn't have a port set.

      Examples:

       // assertions succeed
       assertThat(spanWithNoPort).hasPortThatIsNotSet();
      
       // assertions fail
       assertThat(spanWithPort80).hasPortThatIsNotSet();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has port that was set
      Since:
      1.0.0
    • hasPortThatIsSet

      public SELF hasPortThatIsSet()
      Verifies that this span has a port set.

      Examples:

       // assertions succeed
       assertThat(spanWithPort80).hasPortThatIsSet();
      
       // assertions fail
       assertThat(spanWithNoPort).hasPortThatIsSet();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has port that wasn't set
      Since:
      1.0.0
    • hasLink

      public SELF hasLink(io.micrometer.tracing.Link link)
      Verifies that this span has a link.

      Examples:

       // assertions succeed
       Link linkPresentInSpan = ...;
       assertThat(spanWithALink).hasLink(linkPresentInSpan);
      
       // assertions fail
       Link linkNotPresentInSpan = ...;
       assertThat(spanWithALink).hasLink(linkNotPresentInSpan);
      Parameters:
      link - link to check
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there's no matching link
      Since:
      1.1.0
    • doesNotHaveLink

      public SELF doesNotHaveLink(io.micrometer.tracing.Link link)
      Verifies that this span does not have a link.

      Examples:

       // assertions succeed
       Link linkNotPresentInSpan = ...;
       assertThat(spanWithALink).doesNotHaveLink(linkNotPresentInSpan);
      
       // assertions fail
       Link linkNotPresentInSpan = ...;
       assertThat(spanWithALink).doesNotHaveLink(linkNotPresentInSpan);
      Parameters:
      link - link to check
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there's a matching link
      Since:
      1.1.0
    • hasLink

      public SELF hasLink(Consumer<io.micrometer.tracing.Link> consumer)
      Verifies that this span has at least one link that passes the assertion function.

      Examples:

       // assertions succeed
       assertThat(spanWithALinkWithTags).hasLink(link -> Assertions.assertThat(link.getTags()).isNotEmpty());
      
       // assertions fail
       assertThat(spanWithALinkWithNoTags).hasLink(link -> Assertions.assertThat(link.getTags()).isNotEmpty());
      Parameters:
      consumer - user assertion function to assert the trace context and tags against
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if the assertion from the assertion has failed for all links entries
      Since:
      1.1.0
    • doesNotHaveLink

      public SELF doesNotHaveLink(Consumer<io.micrometer.tracing.Link> consumer)
      Verifies that this span has no links that passes the assertion function.

      Examples:

       // assertions succeed
       assertThat(spanWithALinkWithNoTags).doesNotHaveLink(link -> Assertions.assertThat(link.getTags()).isNotEmpty());
      
       // assertions fail
       assertThat(spanWithALinkWithTags).doesNotHaveLink(link -> Assertions.assertThat(link.getTags()).isNotEmpty());
      Parameters:
      consumer - user assertion function to assert the trace context and tags against
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if the assertion from the assertion has failed for all links entries
      Since:
      1.1.0
    • hasSpanIdEqualTo

      public SELF hasSpanIdEqualTo(String spanId)
      Verifies that this span has span id equal to the given value.

      Examples:

       // assertions succeed
       assertThat(spanWithId123).hasSpanIdEqualTo("123");
      
       // assertions fail
       assertThat(spanWithId123).hasSpanIdEqualTo("234");
      Parameters:
      spanId - span id
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has a span id not equal to the given one
      Since:
      1.0.4
    • doesNotHaveSpanIdEqualTo

      public SELF doesNotHaveSpanIdEqualTo(String spanId)
      Verifies that this span doesn't have span id equal to the given value.

      Examples:

       // assertions succeed
       assertThat(spanWithId123).hasSpanIdEqualTo("234");
      
       // assertions fail
       assertThat(spanWithId123).hasSpanIdEqualTo("123");
      Parameters:
      spanId - span id
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has a span id equal to the given one
      Since:
      1.0.4
    • hasTraceIdEqualTo

      public SELF hasTraceIdEqualTo(String spanId)
      Verifies that this span has trace id equal to the given value.

      Examples:

       // assertions succeed
       assertThat(spanWithTraceId123).hasTraceIdEqualTo("123");
      
       // assertions fail
       assertThat(spanWithTraceId123).hasTraceIdEqualTo("234");
      Parameters:
      spanId - span id
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has a trace id not equal to the given one
      Since:
      1.0.4
    • doesNotHaveTraceIdEqualTo

      public SELF doesNotHaveTraceIdEqualTo(String spanId)
      Verifies that this span doesn't have trace id equal to the given value.

      Examples:

       // assertions succeed
       assertThat(spanWithTraceId123).hasTraceIdEqualTo("234");
      
       // assertions fail
       assertThat(spanWithTraceId123).hasTraceIdEqualTo("123");
      Parameters:
      spanId - span id
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if span has a span id equal to the given one
      Since:
      1.0.4