Package io.micrometer.core.tck
Class MeterRegistryAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<MeterRegistryAssert,io.micrometer.core.instrument.MeterRegistry>
io.micrometer.core.tck.MeterRegistryAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<MeterRegistryAssert,,io.micrometer.core.instrument.MeterRegistry> org.assertj.core.api.Descriptable<MeterRegistryAssert>,org.assertj.core.api.ExtensionPoints<MeterRegistryAssert,io.micrometer.core.instrument.MeterRegistry>
public class MeterRegistryAssert
extends org.assertj.core.api.AbstractAssert<MeterRegistryAssert,io.micrometer.core.instrument.MeterRegistry>
Assertion methods for
MeterRegistrys.
To create a new instance of this class, invoke
assertThat(MeterRegistry) or
then(MeterRegistry).
- Since:
- 1.10.0
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMeterRegistryAssert(io.micrometer.core.instrument.MeterRegistry actual) -
Method Summary
Modifier and TypeMethodDescriptionstatic MeterRegistryAssertassertThat(io.micrometer.core.instrument.MeterRegistry actual) Creates the assert object forMeterRegistry.doesNotHaveMeterWithName(String meterName) Verifies that a meter with given name does not exist in the providedMeterRegistry.doesNotHaveMeterWithNameAndTagKeys(String meterName, String... tagKeys) Verifies that a meter with given name and tag keys does not exist in the providedMeterRegistry.doesNotHaveMeterWithNameAndTags(String meterName, io.micrometer.common.KeyValues tags) Verifies that a meter with given name and key-value tags does not exist in the providedMeterRegistry.doesNotHaveMeterWithNameAndTags(String meterName, io.micrometer.core.instrument.Tags tags) Verifies that a meter with given name and key-value tags does not exist in the providedMeterRegistry.doesNotHaveTimerWithName(String timerName) Verifies that a timer with given name does not exist in the providedMeterRegistry.doesNotHaveTimerWithNameAndTagKeys(String timerName, String... tagKeys) Verifies that a timer with given name and tag keys does not exist in the providedMeterRegistry.doesNotHaveTimerWithNameAndTags(String timerName, io.micrometer.common.KeyValues tags) Verifies that a timer with given name and key-value tags does not exist in the providedMeterRegistry.doesNotHaveTimerWithNameAndTags(String timerName, io.micrometer.core.instrument.Tags tags) Verifies that a timer with given name and key-value tags does not exist in the providedMeterRegistry.hasMeterWithName(String meterName) Verifies that a meter with given name exists in the providedMeterRegistry.hasMeterWithNameAndTagKeys(String meterName, String... tagKeys) Verifies that a meter with given name and tag keys exists in the providedMeterRegistry.hasMeterWithNameAndTags(String meterName, io.micrometer.common.KeyValues tags) Verifies that a meter with given name and key-value tags exists in the providedMeterRegistry.hasMeterWithNameAndTags(String meterName, io.micrometer.core.instrument.Tags tags) Verifies that a meter with given name and key-value tags exists in the providedMeterRegistry.Verifies that there are no metrics in the registry.hasTimerWithName(String timerName) Verifies that a timer with given name exists in the providedMeterRegistry.hasTimerWithNameAndTagKeys(String timerName, String... tagKeys) Verifies that a timer with given name and tag keys exists in the providedMeterRegistry.hasTimerWithNameAndTags(String timerName, io.micrometer.common.KeyValues tags) Verifies that a timer with given name and key-value tags exists in the providedMeterRegistry.hasTimerWithNameAndTags(String timerName, io.micrometer.core.instrument.Tags tags) Verifies that a timer with given name and key-value tags exists in the providedMeterRegistry.static MeterRegistryAssertthen(io.micrometer.core.instrument.MeterRegistry actual) Creates the assert object forMeterRegistry.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
-
MeterRegistryAssert
protected MeterRegistryAssert(io.micrometer.core.instrument.MeterRegistry actual)
-
-
Method Details
-
assertThat
Creates the assert object forMeterRegistry.- Parameters:
actual- meter registry to assert against- Returns:
- meter registry assertions
-
then
Creates the assert object forMeterRegistry.- Parameters:
actual- meter registry to assert against- Returns:
- meter registry assertions
-
hasNoMetrics
Verifies that there are no metrics in the registry.- Returns:
- this
- Throws:
AssertionError- if there are any metrics registered
-
hasMeterWithName
Verifies that a meter with given name exists in the providedMeterRegistry.- Parameters:
meterName- name of the meter- Returns:
- this
- Throws:
AssertionError- if the actual value isnull.AssertionError- if there is no meter registered under given name.
-
hasTimerWithName
Verifies that a timer with given name exists in the providedMeterRegistry.- Parameters:
timerName- name of the timer- Returns:
- this
- Throws:
AssertionError- if the actual value isnull.AssertionError- if there is no timer registered under given name.
-
doesNotHaveMeterWithName
Verifies that a meter with given name does not exist in the providedMeterRegistry.- Parameters:
meterName- name of the meter that should not be present- Returns:
- this
- Throws:
AssertionError- if there is a meter registered under given name.
-
doesNotHaveTimerWithName
Verifies that a timer with given name does not exist in the providedMeterRegistry.- Parameters:
timerName- name of the timer that should not be present- Returns:
- this
- Throws:
AssertionError- if there is a timer registered under given name.
-
hasMeterWithNameAndTags
public MeterRegistryAssert hasMeterWithNameAndTags(String meterName, io.micrometer.core.instrument.Tags tags) Verifies that a meter with given name and key-value tags exists in the providedMeterRegistry.- Parameters:
meterName- name of the metertags- key-value pairs of tags- Returns:
- this
- Throws:
AssertionError- if the actual value isnull.AssertionError- if there is no meter registered under given name with given tags.
-
hasTimerWithNameAndTags
public MeterRegistryAssert hasTimerWithNameAndTags(String timerName, io.micrometer.core.instrument.Tags tags) Verifies that a timer with given name and key-value tags exists in the providedMeterRegistry.- Parameters:
timerName- name of the timertags- key-value pairs of tags- Returns:
- this
- Throws:
AssertionError- if the actual value isnull.AssertionError- if there is no timer registered under given name with given tags.
-
hasMeterWithNameAndTags
public MeterRegistryAssert hasMeterWithNameAndTags(String meterName, io.micrometer.common.KeyValues tags) Verifies that a meter with given name and key-value tags exists in the providedMeterRegistry.- Parameters:
meterName- name of the metertags- key-value pairs of tags- Returns:
- this
- Throws:
AssertionError- if the actual value isnull.AssertionError- if there is no meter registered under given name with given tags.
-
hasTimerWithNameAndTags
public MeterRegistryAssert hasTimerWithNameAndTags(String timerName, io.micrometer.common.KeyValues tags) Verifies that a timer with given name and key-value tags exists in the providedMeterRegistry.- Parameters:
timerName- name of the timertags- key-value pairs of tags- Returns:
- this
- Throws:
AssertionError- if the actual value isnull.AssertionError- if there is no timer registered under given name with given tags.
-
doesNotHaveMeterWithNameAndTags
public MeterRegistryAssert doesNotHaveMeterWithNameAndTags(String meterName, io.micrometer.core.instrument.Tags tags) Verifies that a meter with given name and key-value tags does not exist in the providedMeterRegistry.- Parameters:
meterName- name of the metertags- key-value pairs of tags- Returns:
- this
- Throws:
AssertionError- if there is a meter registered under given name with given tags.
-
doesNotHaveTimerWithNameAndTags
public MeterRegistryAssert doesNotHaveTimerWithNameAndTags(String timerName, io.micrometer.core.instrument.Tags tags) Verifies that a timer with given name and key-value tags does not exist in the providedMeterRegistry.- Parameters:
timerName- name of the timertags- key-value pairs of tags- Returns:
- this
- Throws:
AssertionError- if there is a timer registered under given name with given tags.
-
doesNotHaveMeterWithNameAndTags
public MeterRegistryAssert doesNotHaveMeterWithNameAndTags(String meterName, io.micrometer.common.KeyValues tags) Verifies that a meter with given name and key-value tags does not exist in the providedMeterRegistry.- Parameters:
meterName- name of the metertags- key-value pairs of tags- Returns:
- this
- Throws:
AssertionError- if there is a meter registered under given name with given tags.
-
doesNotHaveTimerWithNameAndTags
public MeterRegistryAssert doesNotHaveTimerWithNameAndTags(String timerName, io.micrometer.common.KeyValues tags) Verifies that a timer with given name and key-value tags does not exist in the providedMeterRegistry.- Parameters:
timerName- name of the timertags- key-value pairs of tags- Returns:
- this
- Throws:
AssertionError- if there is a timer registered under given name with given tags.
-
hasMeterWithNameAndTagKeys
Verifies that a meter with given name and tag keys exists in the providedMeterRegistry.- Parameters:
meterName- name of the metertagKeys- tag keys- Returns:
- this
- Throws:
AssertionError- if the actual value isnull.AssertionError- if there is no meter registered under given name with given tag keys.
-
hasTimerWithNameAndTagKeys
Verifies that a timer with given name and tag keys exists in the providedMeterRegistry.- Parameters:
timerName- name of the timertagKeys- tag keys- Returns:
- this
- Throws:
AssertionError- if the actual value isnull.AssertionError- if there is no timer registered under given name with given tag keys.
-
doesNotHaveMeterWithNameAndTagKeys
Verifies that a meter with given name and tag keys does not exist in the providedMeterRegistry.- Parameters:
meterName- name of the metertagKeys- tag keys- Returns:
- this
- Throws:
AssertionError- if there is a meter registered under given name with given tag keys.
-
doesNotHaveTimerWithNameAndTagKeys
Verifies that a timer with given name and tag keys does not exist in the providedMeterRegistry.- Parameters:
timerName- name of the timertagKeys- tag keys- Returns:
- this
- Throws:
AssertionError- if there is a timer registered under given name with given tag keys.
-