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

    Constructors
    Modifier
    Constructor
    Description
    protected
    MeterRegistryAssert(io.micrometer.core.instrument.MeterRegistry actual)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    assertThat(io.micrometer.core.instrument.MeterRegistry actual)
    Creates the assert object for MeterRegistry.
    Verifies that a meter with given name does not exist in the provided MeterRegistry.
    Verifies that a meter with given name and tag keys does not exist in the provided MeterRegistry.
    doesNotHaveMeterWithNameAndTags(String meterName, io.micrometer.common.KeyValues tags)
    Verifies that a meter with given name and key-value tags does not exist in the provided MeterRegistry.
    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 provided MeterRegistry.
    Verifies that a timer with given name does not exist in the provided MeterRegistry.
    Verifies that a timer with given name and tag keys does not exist in the provided MeterRegistry.
    doesNotHaveTimerWithNameAndTags(String timerName, io.micrometer.common.KeyValues tags)
    Verifies that a timer with given name and key-value tags does not exist in the provided MeterRegistry.
    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 provided MeterRegistry.
    Verifies that a meter with given name exists in the provided MeterRegistry.
    hasMeterWithNameAndTagKeys(String meterName, String... tagKeys)
    Verifies that a meter with given name and tag keys exists in the provided MeterRegistry.
    hasMeterWithNameAndTags(String meterName, io.micrometer.common.KeyValues tags)
    Verifies that a meter with given name and key-value tags exists in the provided MeterRegistry.
    hasMeterWithNameAndTags(String meterName, io.micrometer.core.instrument.Tags tags)
    Verifies that a meter with given name and key-value tags exists in the provided MeterRegistry.
    Verifies that there are no metrics in the registry.
    Verifies that a timer with given name exists in the provided MeterRegistry.
    hasTimerWithNameAndTagKeys(String timerName, String... tagKeys)
    Verifies that a timer with given name and tag keys exists in the provided MeterRegistry.
    hasTimerWithNameAndTags(String timerName, io.micrometer.common.KeyValues tags)
    Verifies that a timer with given name and key-value tags exists in the provided MeterRegistry.
    hasTimerWithNameAndTags(String timerName, io.micrometer.core.instrument.Tags tags)
    Verifies that a timer with given name and key-value tags exists in the provided MeterRegistry.
    then(io.micrometer.core.instrument.MeterRegistry actual)
    Creates the assert object for MeterRegistry.

    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, 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
  • Constructor Details

    • MeterRegistryAssert

      protected MeterRegistryAssert(io.micrometer.core.instrument.MeterRegistry actual)
  • Method Details

    • assertThat

      public static MeterRegistryAssert assertThat(io.micrometer.core.instrument.MeterRegistry actual)
      Creates the assert object for MeterRegistry.
      Parameters:
      actual - meter registry to assert against
      Returns:
      meter registry assertions
    • then

      public static MeterRegistryAssert then(io.micrometer.core.instrument.MeterRegistry actual)
      Creates the assert object for MeterRegistry.
      Parameters:
      actual - meter registry to assert against
      Returns:
      meter registry assertions
    • hasNoMetrics

      public MeterRegistryAssert hasNoMetrics()
      Verifies that there are no metrics in the registry.
      Returns:
      this
      Throws:
      AssertionError - if there are any metrics registered
    • hasMeterWithName

      public MeterRegistryAssert hasMeterWithName(String meterName)
      Verifies that a meter with given name exists in the provided MeterRegistry.
      Parameters:
      meterName - name of the meter
      Returns:
      this
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no meter registered under given name.
    • hasTimerWithName

      public MeterRegistryAssert hasTimerWithName(String timerName)
      Verifies that a timer with given name exists in the provided MeterRegistry.
      Parameters:
      timerName - name of the timer
      Returns:
      this
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no timer registered under given name.
    • doesNotHaveMeterWithName

      public MeterRegistryAssert doesNotHaveMeterWithName(String meterName)
      Verifies that a meter with given name does not exist in the provided MeterRegistry.
      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

      public MeterRegistryAssert doesNotHaveTimerWithName(String timerName)
      Verifies that a timer with given name does not exist in the provided MeterRegistry.
      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 provided MeterRegistry.
      Parameters:
      meterName - name of the meter
      tags - key-value pairs of tags
      Returns:
      this
      Throws:
      AssertionError - if the actual value is null.
      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 provided MeterRegistry.
      Parameters:
      timerName - name of the timer
      tags - key-value pairs of tags
      Returns:
      this
      Throws:
      AssertionError - if the actual value is null.
      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 provided MeterRegistry.
      Parameters:
      meterName - name of the meter
      tags - key-value pairs of tags
      Returns:
      this
      Throws:
      AssertionError - if the actual value is null.
      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 provided MeterRegistry.
      Parameters:
      timerName - name of the timer
      tags - key-value pairs of tags
      Returns:
      this
      Throws:
      AssertionError - if the actual value is null.
      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 provided MeterRegistry.
      Parameters:
      meterName - name of the meter
      tags - 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 provided MeterRegistry.
      Parameters:
      timerName - name of the timer
      tags - 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 provided MeterRegistry.
      Parameters:
      meterName - name of the meter
      tags - 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 provided MeterRegistry.
      Parameters:
      timerName - name of the timer
      tags - key-value pairs of tags
      Returns:
      this
      Throws:
      AssertionError - if there is a timer registered under given name with given tags.
    • hasMeterWithNameAndTagKeys

      public MeterRegistryAssert hasMeterWithNameAndTagKeys(String meterName, String... tagKeys)
      Verifies that a meter with given name and tag keys exists in the provided MeterRegistry.
      Parameters:
      meterName - name of the meter
      tagKeys - tag keys
      Returns:
      this
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no meter registered under given name with given tag keys.
    • hasTimerWithNameAndTagKeys

      public MeterRegistryAssert hasTimerWithNameAndTagKeys(String timerName, String... tagKeys)
      Verifies that a timer with given name and tag keys exists in the provided MeterRegistry.
      Parameters:
      timerName - name of the timer
      tagKeys - tag keys
      Returns:
      this
      Throws:
      AssertionError - if the actual value is null.
      AssertionError - if there is no timer registered under given name with given tag keys.
    • doesNotHaveMeterWithNameAndTagKeys

      public MeterRegistryAssert doesNotHaveMeterWithNameAndTagKeys(String meterName, String... tagKeys)
      Verifies that a meter with given name and tag keys does not exist in the provided MeterRegistry.
      Parameters:
      meterName - name of the meter
      tagKeys - tag keys
      Returns:
      this
      Throws:
      AssertionError - if there is a meter registered under given name with given tag keys.
    • doesNotHaveTimerWithNameAndTagKeys

      public MeterRegistryAssert doesNotHaveTimerWithNameAndTagKeys(String timerName, String... tagKeys)
      Verifies that a timer with given name and tag keys does not exist in the provided MeterRegistry.
      Parameters:
      timerName - name of the timer
      tagKeys - tag keys
      Returns:
      this
      Throws:
      AssertionError - if there is a timer registered under given name with given tag keys.