Package io.micrometer.observation.tck
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedObservationContextAssert(io.micrometer.observation.Observation.ContextView actual) -
Method Summary
Modifier and TypeMethodDescriptionstatic ObservationContextAssert<?> assertThat(io.micrometer.observation.Observation.ContextView actual) Creates the assert object forObservation.ContextView.doesNotHaveHighCardinalityKeyValue(String key, String value) doesNotHaveLowCardinalityKeyValue(String key, String value) doesNotHaveMapEntry(Object key, Object value) doesNotHaveNameEqualTo(String name) Verify that the ObservationObservation.ContextViewdoes not have aparent Observation.hasError()hasHighCardinalityKeyValue(String key, String value) hasKeyValuesCount(int size) hasLowCardinalityKeyValue(String key, String value) hasMapEntry(Object key, Object value) hasNameEqualTo(String name) hasOnlyKeys(String... keys) Verify that the ObservationObservation.ContextViewhas aparent Observation.hasParentObservationContextMatching(Predicate<? super io.micrometer.observation.Observation.ContextView> parentContextViewPredicate) Verify that the ObservationObservation.ContextViewhas aparent Observationand that it matches the provided unnamed predicate.hasParentObservationContextMatching(Predicate<? super io.micrometer.observation.Observation.ContextView> parentContextViewPredicate, String description) Verify that the ObservationObservation.ContextViewhas aparent Observationand that it matches the provided named predicate.hasParentObservationContextSatisfying(org.assertj.core.api.ThrowingConsumer<io.micrometer.observation.Observation.ContextView> parentContextViewAssertion) Verify that the ObservationObservation.ContextViewhas aparent Observationand that it satisfies assertions performed in the providedConsumer.hasParentObservationEqualTo(io.micrometer.observation.Observation expectedParent) Verify that the ObservationObservation.ContextViewhas aparent Observationequal to the providedObservation.hasSubsetOfKeys(String... keys) Verifies that the Observation key-value keys are a subset of the given set of keys.static ObservationContextAssert<?> then(io.micrometer.observation.Observation.ContextView actual) Creates the assert object forObservation.ContextView.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, withThreadDumpOnErrorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs
-
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 forObservation.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 forObservation.ContextView.- Parameters:
actual- context to assert against- Returns:
- Observation assertions
-
hasNameEqualTo
-
doesNotHaveNameEqualTo
-
hasNameEqualToIgnoringCase
-
doesNotHaveNameEqualToIgnoringCase
-
hasContextualNameEqualTo
-
doesNotHaveContextualNameEqualTo
-
hasContextualNameEqualToIgnoringCase
-
doesNotHaveContextualNameEqualToIgnoringCase
-
hasNoKeyValues
-
hasAnyKeyValues
-
hasKeyValuesCount
-
hasOnlyKeys
-
hasSubsetOfKeys
Verifies that the Observation key-value keys are a subset of the given set of keys. -
hasLowCardinalityKeyValueWithKey
-
hasLowCardinalityKeyValue
-
doesNotHaveLowCardinalityKeyValueWithKey
-
doesNotHaveLowCardinalityKeyValue
-
hasHighCardinalityKeyValueWithKey
-
hasHighCardinalityKeyValue
-
doesNotHaveHighCardinalityKeyValueWithKey
-
doesNotHaveHighCardinalityKeyValue
-
hasMapEntry
-
doesNotHaveMapEntry
-
doesNotHaveError
-
hasError
-
hasError
-
assertThatError
-
thenError
-
hasParentObservation
Verify that the ObservationObservation.ContextViewhas aparent Observation.- Returns:
- the instance for further fluent assertion
-
hasParentObservationEqualTo
Verify that the ObservationObservation.ContextViewhas aparent Observationequal to the providedObservation.- Returns:
- the instance for further fluent assertion
-
doesNotHaveParentObservation
Verify that the ObservationObservation.ContextViewdoes not have aparent 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 ObservationObservation.ContextViewhas aparent Observationand that it satisfies assertions performed in the providedConsumer.- Returns:
- the instance for further fluent assertion
-
hasParentObservationContextMatching
public SELF hasParentObservationContextMatching(Predicate<? super io.micrometer.observation.Observation.ContextView> parentContextViewPredicate) Verify that the ObservationObservation.ContextViewhas aparent Observationand 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 ObservationObservation.ContextViewhas aparent Observationand that it matches the provided named predicate.- Returns:
- the instance for further fluent assertion
-