Class TracerAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<TracerAssert,SimpleTracer>
io.micrometer.tracing.test.simple.TracerAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<TracerAssert,SimpleTracer>, org.assertj.core.api.Descriptable<TracerAssert>, org.assertj.core.api.ExtensionPoints<TracerAssert,SimpleTracer>

public class TracerAssert extends org.assertj.core.api.AbstractAssert<TracerAssert,SimpleTracer>
Assertion methods for SimpleTracers.

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

Since:
1.0.0
  • Field Summary

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

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

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a new instance of TracerAssert.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates the assert object for SimpleTracer.
    Returns assertion options for the last span created by SimpleTracer.
    Verifies that there was only one span created by a SimpleTracer.
    org.assertj.core.api.AbstractCollectionAssert<?,Collection<? extends SimpleSpan>,SimpleSpan,org.assertj.core.api.ObjectAssert<SimpleSpan>>
    Returns assertion options for all spans created by SimpleTracer.
    Creates the assert object for SimpleTracer.

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

    areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, 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, describedAs
  • Constructor Details

  • Method Details

    • assertThat

      public static TracerAssert assertThat(SimpleTracer actual)
      Creates the assert object for SimpleTracer.
      Parameters:
      actual - tracer to assert against
      Returns:
      meter registry assertions
    • then

      public static TracerAssert then(SimpleTracer actual)
      Creates the assert object for SimpleTracer.
      Parameters:
      actual - tracer to assert against
      Returns:
      meter registry assertions
    • onlySpan

      public SpanAssert onlySpan()
      Verifies that there was only one span created by a SimpleTracer.

      Examples:

       // assertions succeed
       assertThat(simpleTracer).onlySpan();
      
       // assertions fail
       assertThat(simpleTracerWithNoSpans).onlySpan();
      Returns:
      SpanAssert assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there were zero or more than one spans
      AssertionError - if the span wasn't started
      Since:
      1.0.0
    • lastSpan

      public SpanAssert lastSpan()
      Returns assertion options for the last span created by SimpleTracer.

      Examples:

       // assertions succeed
       assertThat(simpleTracer).lastSpan();
      
       // assertions fail
       assertThat(simpleTracerWithNoSpans).lastSpan();
      Returns:
      SpanAssert assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there were no spans
      AssertionError - if the span wasn't started
      Since:
      1.0.0
    • reportedSpans

      public org.assertj.core.api.AbstractCollectionAssert<?,Collection<? extends SimpleSpan>,SimpleSpan,org.assertj.core.api.ObjectAssert<SimpleSpan>> reportedSpans()
      Returns assertion options for all spans created by SimpleTracer.

      Examples:

       // assertions succeed
       assertThat(simpleTracer).reportedSpans();
      
       // assertions fail
       assertThat(simpleTracerWithNoSpans).reportedSpans();
      Returns:
      SpanAssert assertion object.
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there were no spans created by this tracer
      Since:
      1.0.0