Class ObservationContextAssert<SELF extends ObservationContextAssert<SELF>>

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,io.micrometer.observation.Observation.ContextView>
io.micrometer.observation.tck.ObservationContextAssert<SELF>
All Implemented Interfaces:
org.assertj.core.api.Assert<SELF,io.micrometer.observation.Observation.ContextView>, org.assertj.core.api.Descriptable<SELF>, org.assertj.core.api.ExtensionPoints<SELF,io.micrometer.observation.Observation.ContextView>
Direct Known Subclasses:
TestObservationRegistryAssert.TestObservationRegistryAssertReturningObservationContextAssert

public class ObservationContextAssert<SELF extends ObservationContextAssert<SELF>> extends org.assertj.core.api.AbstractAssert<SELF,io.micrometer.observation.Observation.ContextView>
Assertion methods for Observation.Contexts and Observation.ContextViews.

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

Since:
1.10.0
  • Constructor Details

    • ObservationContextAssert

      protected ObservationContextAssert(io.micrometer.observation.Observation.ContextView actual)
  • Method Details

    • assertThat

      public static ObservationContextAssert<?> assertThat(io.micrometer.observation.Observation.ContextView actual)
      Creates the assert object for Observation.ContextView.
      Parameters:
      actual - context to assert against
      Returns:
      Observation assertions
    • then

      public static ObservationContextAssert<?> then(io.micrometer.observation.Observation.ContextView actual)
      Creates the assert object for Observation.ContextView.
      Parameters:
      actual - context to assert against
      Returns:
      Observation assertions
    • hasNameEqualTo

      public SELF hasNameEqualTo(String name)
    • doesNotHaveNameEqualTo

      public SELF doesNotHaveNameEqualTo(String name)
    • hasNameEqualToIgnoringCase

      public SELF hasNameEqualToIgnoringCase(String name)
    • doesNotHaveNameEqualToIgnoringCase

      public SELF doesNotHaveNameEqualToIgnoringCase(String name)
    • hasContextualNameEqualTo

      public SELF hasContextualNameEqualTo(String name)
    • doesNotHaveContextualNameEqualTo

      public SELF doesNotHaveContextualNameEqualTo(String name)
    • hasContextualNameEqualToIgnoringCase

      public SELF hasContextualNameEqualToIgnoringCase(String name)
    • doesNotHaveContextualNameEqualToIgnoringCase

      public SELF doesNotHaveContextualNameEqualToIgnoringCase(String name)
    • hasNoKeyValues

      public SELF hasNoKeyValues()
    • hasAnyKeyValues

      public SELF hasAnyKeyValues()
    • hasKeyValuesCount

      public SELF hasKeyValuesCount(int size)
    • hasOnlyKeys

      public SELF hasOnlyKeys(String... keys)
    • hasSubsetOfKeys

      public SELF hasSubsetOfKeys(String... keys)
      Verifies that the Observation key-value keys are a subset of the given set of keys.
    • hasLowCardinalityKeyValueWithKey

      public SELF hasLowCardinalityKeyValueWithKey(String key)
    • hasLowCardinalityKeyValue

      public SELF hasLowCardinalityKeyValue(String key, String value)
    • doesNotHaveLowCardinalityKeyValueWithKey

      public SELF doesNotHaveLowCardinalityKeyValueWithKey(String key)
    • doesNotHaveLowCardinalityKeyValue

      public SELF doesNotHaveLowCardinalityKeyValue(String key, String value)
    • hasHighCardinalityKeyValueWithKey

      public SELF hasHighCardinalityKeyValueWithKey(String key)
    • hasHighCardinalityKeyValue

      public SELF hasHighCardinalityKeyValue(String key, String value)
    • doesNotHaveHighCardinalityKeyValueWithKey

      public SELF doesNotHaveHighCardinalityKeyValueWithKey(String key)
    • doesNotHaveHighCardinalityKeyValue

      public SELF doesNotHaveHighCardinalityKeyValue(String key, String value)
    • hasMapEntry

      public SELF hasMapEntry(Object key, Object value)
    • doesNotHaveMapEntry

      public SELF doesNotHaveMapEntry(Object key, Object value)
    • doesNotHaveError

      public SELF doesNotHaveError()
    • hasError

      public SELF hasError()
    • hasError

      public SELF hasError(Throwable expectedError)
    • assertThatError

    • thenError

    • hasParentObservation

      public SELF hasParentObservation()
      Verify that the Observation Observation.ContextView has a parent Observation.
      Returns:
      the instance for further fluent assertion
    • hasParentObservationEqualTo

      public SELF hasParentObservationEqualTo(io.micrometer.observation.Observation expectedParent)
      Verify that the Observation Observation.ContextView has a parent Observation equal to the provided Observation.
      Returns:
      the instance for further fluent assertion
    • doesNotHaveParentObservation

      public SELF doesNotHaveParentObservation()
      Verify that the Observation Observation.ContextView does not have a parent Observation.
      Returns:
      the instance for further fluent assertion
    • hasParentObservationContextSatisfying

      public SELF hasParentObservationContextSatisfying(org.assertj.core.api.ThrowingConsumer<io.micrometer.observation.Observation.ContextView> parentContextViewAssertion)
      Verify that the Observation Observation.ContextView has a parent Observation and that it satisfies assertions performed in the provided Consumer.
      Returns:
      the instance for further fluent assertion
    • hasParentObservationContextMatching

      public SELF hasParentObservationContextMatching(Predicate<? super io.micrometer.observation.Observation.ContextView> parentContextViewPredicate)
      Verify that the Observation Observation.ContextView has a parent Observation and that it matches the provided unnamed predicate.
      Returns:
      the instance for further fluent assertion
      See Also:
    • hasParentObservationContextMatching

      public SELF hasParentObservationContextMatching(Predicate<? super io.micrometer.observation.Observation.ContextView> parentContextViewPredicate, String description)
      Verify that the Observation Observation.ContextView has a parent Observation and that it matches the provided named predicate.
      Returns:
      the instance for further fluent assertion