Package io.micrometer.observation.tck
Class ObservationRegistryAssert<SELF extends ObservationRegistryAssert<SELF,ACTUAL>,ACTUAL extends io.micrometer.observation.ObservationRegistry>
java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
io.micrometer.observation.tck.ObservationRegistryAssert<SELF,ACTUAL>
- All Implemented Interfaces:
org.assertj.core.api.Assert<SELF,,ACTUAL> org.assertj.core.api.Descriptable<SELF>,org.assertj.core.api.ExtensionPoints<SELF,ACTUAL>
- Direct Known Subclasses:
TestObservationRegistryAssert
public class ObservationRegistryAssert<SELF extends ObservationRegistryAssert<SELF,ACTUAL>,ACTUAL extends io.micrometer.observation.ObservationRegistry>
extends org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
Assertion methods for
MeterRegistrys.
To create a new instance of this class, invoke
assertThat(ObservationRegistry) or
then(ObservationRegistry).
- Since:
- 1.10.0
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedObservationRegistryAssert(ACTUAL actual) protectedObservationRegistryAssert(ACTUAL actual, Class<SELF> clazz) -
Method Summary
Modifier and TypeMethodDescriptionstatic ObservationRegistryAssertassertThat(io.micrometer.observation.ObservationRegistry actual) Creates the assert object forObservationRegistry.Verifies that there's no currentObservationleft in theObservationRegistry.Verifies that there's no currentObservation.Scopeleft in theObservationRegistry.doesNotHaveRemainingCurrentObservationSameAs(io.micrometer.observation.Observation observation) Verifies that there's no currentObservationleft in theObservationRegistry.doesNotHaveRemainingCurrentScopeSameAs(io.micrometer.observation.Observation.Scope scope) Verifies that the currentObservation.Scopein theObservationRegistryis not the same as the provided scope.Verifies that there's a currentObservationleft in theObservationRegistry.hasRemainingCurrentObservationSameAs(io.micrometer.observation.Observation observation) Verifies that there's a currentObservationleft in theObservationRegistry.Verifies that there's a currentObservation.Scopeleft in theObservationRegistry.hasRemainingCurrentScopeSameAs(io.micrometer.observation.Observation.Scope scope) Verifies that the currentObservation.Scopein theObservationRegistryis the same instance as the provided scope.static ObservationRegistryAssertthen(io.micrometer.observation.ObservationRegistry actual) Creates the assert object forObservationRegistry.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, 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, describedAs
-
Constructor Details
-
ObservationRegistryAssert
-
ObservationRegistryAssert
-
-
Method Details
-
assertThat
public static ObservationRegistryAssert assertThat(io.micrometer.observation.ObservationRegistry actual) Creates the assert object forObservationRegistry.- Parameters:
actual- observation registry to assert against- Returns:
- meter registry assertions
-
then
Creates the assert object forObservationRegistry.- Parameters:
actual- observation registry to assert against- Returns:
- meter registry assertions
-
doesNotHaveAnyRemainingCurrentObservation
Verifies that there's no currentObservationleft in theObservationRegistry.- Returns:
- this
- Throws:
AssertionError- if there is a current observation remaining in the registry
-
hasRemainingCurrentObservation
Verifies that there's a currentObservationleft in theObservationRegistry.- Returns:
- this
- Throws:
AssertionError- if there is no current observation remaining in the registry
-
doesNotHaveRemainingCurrentObservationSameAs
public SELF doesNotHaveRemainingCurrentObservationSameAs(io.micrometer.observation.Observation observation) Verifies that there's no currentObservationleft in theObservationRegistry.- Parameters:
observation- to compare against- Returns:
- this
- Throws:
AssertionError- if there is a current observation remaining in the registry
-
hasRemainingCurrentObservationSameAs
Verifies that there's a currentObservationleft in theObservationRegistry.- Parameters:
observation- to compare against- Returns:
- this
- Throws:
AssertionError- if there is no current observation remaining in the registry
-
doesNotHaveAnyRemainingCurrentScope
Verifies that there's no currentObservation.Scopeleft in theObservationRegistry.- Returns:
- this
- Throws:
AssertionError- if there is a current scope remaining in the registry
-
hasRemainingCurrentScope
Verifies that there's a currentObservation.Scopeleft in theObservationRegistry.- Returns:
- this
- Throws:
AssertionError- if there is no current scope remaining in the registry
-
doesNotHaveRemainingCurrentScopeSameAs
public SELF doesNotHaveRemainingCurrentScopeSameAs(io.micrometer.observation.Observation.Scope scope) Verifies that the currentObservation.Scopein theObservationRegistryis not the same as the provided scope. This assertion also passes if there is no current scope in the registry.- Returns:
- this
- Throws:
AssertionError- if there is a current scope remaining in the registry and it is the same as the provided scope
-
hasRemainingCurrentScopeSameAs
Verifies that the currentObservation.Scopein theObservationRegistryis the same instance as the provided scope.- Returns:
- this
- Throws:
AssertionError- if the provided scope is not the current scope remaining in the registry
-