Class SpansAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractIterableAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>
org.assertj.core.api.AbstractCollectionAssert<org.assertj.core.api.CollectionAssert<ELEMENT>,Collection<? extends ELEMENT>,ELEMENT,org.assertj.core.api.ObjectAssert<ELEMENT>>
org.assertj.core.api.CollectionAssert<io.micrometer.tracing.exporter.FinishedSpan>
io.micrometer.tracing.test.simple.SpansAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<org.assertj.core.api.CollectionAssert<io.micrometer.tracing.exporter.FinishedSpan>,Collection<? extends io.micrometer.tracing.exporter.FinishedSpan>>, org.assertj.core.api.Descriptable<org.assertj.core.api.CollectionAssert<io.micrometer.tracing.exporter.FinishedSpan>>, org.assertj.core.api.EnumerableAssert<org.assertj.core.api.CollectionAssert<io.micrometer.tracing.exporter.FinishedSpan>,io.micrometer.tracing.exporter.FinishedSpan>, org.assertj.core.api.ExtensionPoints<org.assertj.core.api.CollectionAssert<io.micrometer.tracing.exporter.FinishedSpan>,Collection<? extends io.micrometer.tracing.exporter.FinishedSpan>>, org.assertj.core.api.ObjectEnumerableAssert<org.assertj.core.api.CollectionAssert<io.micrometer.tracing.exporter.FinishedSpan>,io.micrometer.tracing.exporter.FinishedSpan>

public class SpansAssert extends org.assertj.core.api.CollectionAssert<io.micrometer.tracing.exporter.FinishedSpan>
Assertion methods for SimpleSpans.

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

Since:
1.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Syntactic sugar that extends SpanAssert methods with an option to go back to SpansAssert.
  • 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
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    SpansAssert(Collection<? extends io.micrometer.tracing.exporter.FinishedSpan> actual)
    Creates a new instance of SpansAssert.
  • Method Summary

    Modifier and Type
    Method
    Description
    assertThat(Collection<? extends io.micrometer.tracing.exporter.FinishedSpan> actual)
    Creates the assert object for a collection of FinishedSpan.
    Provides verification for the first span having the given name.
    Provides verification for the first span having the given name (ignoring case).
    Provides verification for all spans having the given name.
    Provides verification for all spans having the given name (ignoring case).
    hasASpanWithATag(io.micrometer.common.docs.KeyName key, String value)
    Verifies that there is a span with a tag.
    Verifies that there is a span with a tag.
    hasASpanWithATagKey(io.micrometer.common.docs.KeyName key)
    Verifies that there is a span with a tag key.
    Verifies that there is a span with a tag key.
    Verifies that there is a span with a given name.
    Verifies that there is a span with a given name and also given assertion is met.
    Verifies that there is a span with a given name (ignoring case).
    Verifies that there is a span with a given name (ignoring case) and also given assertion is met.
    Verifies that there is a span with a given remote service name.
    hasNumberOfSpansEqualTo(int expectedNumberOfSpans)
    Verifies that there is a proper number of spans.
    hasNumberOfSpansWithNameEqualTo(String spanName, int expectedNumberOfSpans)
    Verifies that there is a proper number of spans with the given name.
    hasNumberOfSpansWithNameEqualToIgnoreCase(String spanName, int expectedNumberOfSpans)
    Verifies that there is a proper number of spans with the given name (ignoring case).
    Verifies that all spans have the same trace id.
    then(Collection<? extends io.micrometer.tracing.exporter.FinishedSpan> actual)
    Creates the assert object for a collection of FinishedSpan.
    Provides verification for the first span having the given name.
    Provides verification for the first span having the given name (ignoring case).

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

    assertThatCollection, newAbstractIterableAssert, toAssert

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

    isUnmodifiable

    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, satisfiesOnlyOnce, satisfiesOnlyOnce, satisfiesOnlyOnceForProxy, singleElement, singleElement, size, startsWith, startsWithForProxy, usingComparator, usingComparator, usingComparatorForElementFieldsWithNames, usingComparatorForElementFieldsWithType, usingComparatorForType, usingComparisonStrategy, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, usingElementComparatorIgnoringFields, usingElementComparatorOnFields, usingFieldByFieldElementComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparatorIgnoringFields, usingRecursiveFieldByFieldElementComparatorOnFields, withFailMessage, withThreadDumpOnError, zipSatisfy

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

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

    • SpansAssert

      protected SpansAssert(Collection<? extends io.micrometer.tracing.exporter.FinishedSpan> actual)
      Creates a new instance of SpansAssert.
      Parameters:
      actual - actual object to assert
  • Method Details

    • assertThat

      public static SpansAssert assertThat(Collection<? extends io.micrometer.tracing.exporter.FinishedSpan> actual)
      Creates the assert object for a collection of FinishedSpan.
      Parameters:
      actual - span to assert against
      Returns:
      span collection assertions
    • then

      public static SpansAssert then(Collection<? extends io.micrometer.tracing.exporter.FinishedSpan> actual)
      Creates the assert object for a collection of FinishedSpan.
      Parameters:
      actual - span to assert against
      Returns:
      span collection assertions
    • haveSameTraceId

      public SpansAssert haveSameTraceId()
      Verifies that all spans have the same trace id.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpan)).haveSameTraceId();
      
       // assertions fail
       assertThat(Arrays.asList(finishedSpanWithTraceIdX, finishedSpanWithTraceIdY)).haveSameTraceId();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if spans do not have the same trace id.
      Since:
      1.0.0
    • hasASpanWithName

      public SpansAssert hasASpanWithName(String name)
      Verifies that there is a span with a given name.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).hasASpanWithName("foo");
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpanWithNameBar)).hasASpanWithName("foo");
      Parameters:
      name - searched span name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name
      Since:
      1.0.0
    • hasASpanWithName

      public SpansAssert hasASpanWithName(String name, Consumer<SpanAssert> spanConsumer)
      Verifies that there is a span with a given name and also given assertion is met.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).hasASpanWithName("foo", spanAssert -> spanAssert.isStarted());
      
       // assertions fail
       assertThat(Collections.singletonList(notFinishedSpanWithNameFoo)).hasASpanWithName("foo", spanAssert -> spanAssert.isStarted());
      Parameters:
      name - searched span name
      spanConsumer - assertion to be executed for each span
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name
      AssertionError - if the span assertion is not met
      Since:
      1.0.0
    • hasASpanWithNameIgnoreCase

      public SpansAssert hasASpanWithNameIgnoreCase(String name, Consumer<SpanAssert> spanConsumer)
      Verifies that there is a span with a given name (ignoring case) and also given assertion is met.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).hasASpanWithNameIgnoreCase("FoO", spanAssert -> spanAssert.isStarted());
      
       // assertions fail
       assertThat(Collections.singletonList(notFinishedSpanWithNameFoo)).hasASpanWithNameIgnoreCase("FoO", spanAssert -> spanAssert.isStarted());
      Parameters:
      name - searched span name
      spanConsumer - assertion to be executed for each span
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name
      AssertionError - if the span assertion is not met
      Since:
      1.0.0
    • hasASpanWithNameIgnoreCase

      public SpansAssert hasASpanWithNameIgnoreCase(String name)
      Verifies that there is a span with a given name (ignoring case).

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).hasASpanWithNameIgnoreCase("FoO");
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpanWithNameBar)).hasASpanWithNameIgnoreCase("FoO");
      Parameters:
      name - searched span name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name (ignoring case)
      Since:
      1.0.0
    • forAllSpansWithNameEqualTo

      public SpansAssert forAllSpansWithNameEqualTo(String name, Consumer<SpanAssert> spanConsumer)
      Provides verification for all spans having the given name.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).forAllSpansWithNameEqualTo("foo", spanAssert -> spanAssert.isStarted());
      
       // assertions fail
       assertThat(Collections.singletonList(nonStartedSpanWithNameFoo)).forAllSpansWithNameEqualTo("foo", spanAssert -> spanAssert.isStarted());
      Parameters:
      name - searched span name
      spanConsumer - assertion to be executed for each span
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name
      AssertionError - if there is a span with the given name but the additional assertion is not successful
      Since:
      1.0.0
    • forAllSpansWithNameEqualToIgnoreCase

      public SpansAssert forAllSpansWithNameEqualToIgnoreCase(String name, Consumer<SpanAssert> spanConsumer)
      Provides verification for all spans having the given name (ignoring case).

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).forAllSpansWithNameEqualTo("foo", spanAssert -> spanAssert.isStarted());
      
       // assertions fail
       assertThat(Collections.singletonList(nonStartedSpanWithNameFoo)).forAllSpansWithNameEqualTo("foo", spanAssert -> spanAssert.isStarted());
      Parameters:
      name - searched span name (ignoring case)
      spanConsumer - assertion to be executed for each span
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name (ignoring case)
      AssertionError - if there is a span with the given name (ignoring case) but the additional assertion is not successful
      Since:
      1.0.0
    • assertThatASpanWithNameEqualTo

      public SpansAssert.SpansAssertReturningAssert assertThatASpanWithNameEqualTo(String name)
      Provides verification for the first span having the given name.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).assertThatASpanWithNameEqualTo("foo").isStarted();
      
       // assertions fail
       assertThat(Collections.singletonList(notStartedSpanWithNameFoo)).assertThatASpanWithNameEqualTo("foo").isStarted();
      Parameters:
      name - searched span name
      Returns:
      SpansAssert.SpansAssertReturningAssert assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name
      Since:
      1.0.0
    • thenASpanWithNameEqualTo

      public SpansAssert.SpansAssertReturningAssert thenASpanWithNameEqualTo(String name)
      Provides verification for the first span having the given name.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).thenASpanWithNameEqualTo("foo").isStarted();
      
       // assertions fail
       assertThat(Collections.singletonList(notStartedSpanWithNameFoo)).thenASpanWithNameEqualTo("foo").isStarted();
      Parameters:
      name - searched span name
      Returns:
      SpansAssert.SpansAssertReturningAssert assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name
      Since:
      1.0.0
    • assertThatASpanWithNameEqualToIgnoreCase

      public SpansAssert.SpansAssertReturningAssert assertThatASpanWithNameEqualToIgnoreCase(String name)
      Provides verification for the first span having the given name (ignoring case).

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).assertThatASpanWithNameEqualToIgnoreCase("FoO").isStarted();
      
       // assertions fail
       assertThat(Collections.singletonList(notStartedSpanWithNameFoo)).assertThatASpanWithNameEqualToIgnoreCase("FoO").isStarted();
      Parameters:
      name - searched span name (ignoring case)
      Returns:
      SpansAssert.SpansAssertReturningAssert assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name (ignoring case)
      Since:
      1.0.0
    • thenASpanWithNameEqualToIgnoreCase

      public SpansAssert.SpansAssertReturningAssert thenASpanWithNameEqualToIgnoreCase(String name)
      Provides verification for the first span having the given name (ignoring case).

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).thenASpanWithNameEqualToIgnoreCase("FoO").isStarted();
      
       // assertions fail
       assertThat(Collections.singletonList(notStartedSpanWithNameFoo)).thenASpanWithNameEqualToIgnoreCase("FoO").isStarted();
      Parameters:
      name - searched span name (ignoring case)
      Returns:
      SpansAssert.SpansAssertReturningAssert assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with the given name (ignoring case)
      Since:
      1.0.0
    • hasNumberOfSpansEqualTo

      public SpansAssert hasNumberOfSpansEqualTo(int expectedNumberOfSpans)
      Verifies that there is a proper number of spans.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpan)).hasNumberOfSpansEqualTo(1);
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpan)).hasNumberOfSpansEqualTo(2);
      Parameters:
      expectedNumberOfSpans - expected number of spans
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if the number of spans is different from the desired one
      Since:
      1.0.0
    • hasNumberOfSpansWithNameEqualTo

      public SpansAssert hasNumberOfSpansWithNameEqualTo(String spanName, int expectedNumberOfSpans)
      Verifies that there is a proper number of spans with the given name.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).hasNumberOfSpansWithNameEqualTo("foo", 1);
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).hasNumberOfSpansWithNameEqualTo("foo", 2);
      Parameters:
      spanName - span name
      expectedNumberOfSpans - expected number of spans with the given name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if the number of properly named spans is different from the desired one
      Since:
      1.0.0
    • hasNumberOfSpansWithNameEqualToIgnoreCase

      public SpansAssert hasNumberOfSpansWithNameEqualToIgnoreCase(String spanName, int expectedNumberOfSpans)
      Verifies that there is a proper number of spans with the given name (ignoring case).

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).hasNumberOfSpansWithNameEqualToIgnoreCase(1);
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpanWithNameFoo)).hasNumberOfSpansWithNameEqualToIgnoreCase(2);
      Parameters:
      spanName - span name
      expectedNumberOfSpans - expected number of spans with the given name (ignoring case)
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if the number of properly named spans is different from the desired one
      Since:
      1.0.0
    • hasASpanWithRemoteServiceName

      public SpansAssert hasASpanWithRemoteServiceName(String remoteServiceName)
      Verifies that there is a span with a given remote service name.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithRemoteServiceNameFoo)).hasASpanWithRemoteServiceName("FoO");
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpanWithRemoteServiceNameBar)).hasASpanWithRemoteServiceName("FoO");
      Parameters:
      remoteServiceName - searched remote service name
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with given remote service name
      Since:
      1.0.0
    • hasASpanWithATag

      public SpansAssert hasASpanWithATag(String key, String value)
      Verifies that there is a span with a tag.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithTagFooBar)).hasASpanWithATag("foo", "bar");
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpanWithTagBazBar)).hasASpanWithATag("foo", "bar");
      Parameters:
      key - expected tag key
      value - expected tag value
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with given tag key and value
      Since:
      1.0.0
    • hasASpanWithATagKey

      public SpansAssert hasASpanWithATagKey(String key)
      Verifies that there is a span with a tag key.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithTagFooBar)).hasASpanWithATagKey("foo");
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpanWithTagBazBar)).hasASpanWithATagKey("foo");
      Parameters:
      key - expected tag key
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with given tag key
      Since:
      1.0.0
    • hasASpanWithATag

      public SpansAssert hasASpanWithATag(io.micrometer.common.docs.KeyName key, String value)
      Verifies that there is a span with a tag.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithTagFooBar)).hasASpanWithATag(SomeKeyName.FOO, "bar");
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpanWithTagBazBar)).hasASpanWithATag(SomeKeyName.FOO, "baz");
      Parameters:
      key - expected tag key
      value - expected tag value
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with given tag key
      Since:
      1.0.0
    • hasASpanWithATagKey

      public SpansAssert hasASpanWithATagKey(io.micrometer.common.docs.KeyName key)
      Verifies that there is a span with a tag key.

      Examples:

       // assertions succeed
       assertThat(Collections.singletonList(finishedSpanWithTagFooBar)).hasASpanWithATagKey(SomeKeyName.FOO);
      
       // assertions fail
       assertThat(Collections.singletonList(finishedSpanWithTagBazBar)).hasASpanWithATagKey(SomeKeyName.FOO);
      Parameters:
      key - expected tag key
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no span with given tag key
      Since:
      1.0.0