Class MetricAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<MetricAssert,io.opentelemetry.sdk.metrics.data.MetricData>
io.opentelemetry.sdk.testing.assertj.MetricAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<MetricAssert,
,io.opentelemetry.sdk.metrics.data.MetricData> org.assertj.core.api.Descriptable<MetricAssert>
,org.assertj.core.api.ExtensionPoints<MetricAssert,
io.opentelemetry.sdk.metrics.data.MetricData>
public final class MetricAssert
extends org.assertj.core.api.AbstractAssert<MetricAssert,io.opentelemetry.sdk.metrics.data.MetricData>
Assertions for an exported
MetricData
.- Since:
- 1.14.0
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Method Summary
Modifier and TypeMethodDescriptionhasDescription
(String description) Asserts the metric has the given description.hasDoubleGaugeSatisfying
(Consumer<DoubleGaugeAssert> assertion) Asserts thisMetricData
is aDoubleGauge
that satisfies the provided assertion.hasDoubleSumSatisfying
(Consumer<DoubleSumAssert> assertion) Asserts thisMetricData
is a double sum that satisfies the provided assertion.Asserts thisMetricData
is an exponential histogram that satisfies the provided assertion.hasHistogramSatisfying
(Consumer<HistogramAssert> assertion) Asserts thisMetricData
is a histogram that satisfies the provided assertion.hasInstrumentationScope
(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo) Asserts the metric has the given theInstrumentationScopeInfo
.hasLongGaugeSatisfying
(Consumer<LongGaugeAssert> assertion) Asserts thisMetricData
is aLongGauge
that satisfies the provided assertion.hasLongSumSatisfying
(Consumer<LongSumAssert> assertion) Asserts thisMetricData
is a long sum that satisfies the provided assertion.Asserts the metric has the given name.hasResource
(io.opentelemetry.sdk.resources.Resource resource) Asserts the metric has the givenResource
.hasResourceSatisfying
(Consumer<ResourceAssert> resource) Asserts the metric has a resource satisfying the given condition.hasSummarySatisfying
(Consumer<SummaryAssert> assertion) Asserts thisMetricData
is a summary that satisfies the provided assertion.Asserts the metric has the given unit.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, 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, describedAs
-
Method Details
-
hasResource
Asserts the metric has the givenResource
. -
hasResourceSatisfying
Asserts the metric has a resource satisfying the given condition.- Since:
- 1.23.0
-
hasInstrumentationScope
public MetricAssert hasInstrumentationScope(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo) Asserts the metric has the given theInstrumentationScopeInfo
. -
hasName
Asserts the metric has the given name. -
hasDescription
Asserts the metric has the given description. -
hasUnit
Asserts the metric has the given unit. -
hasDoubleGaugeSatisfying
Asserts thisMetricData
is aDoubleGauge
that satisfies the provided assertion. -
hasLongGaugeSatisfying
Asserts thisMetricData
is aLongGauge
that satisfies the provided assertion. -
hasDoubleSumSatisfying
Asserts thisMetricData
is a double sum that satisfies the provided assertion. -
hasLongSumSatisfying
Asserts thisMetricData
is a long sum that satisfies the provided assertion. -
hasHistogramSatisfying
Asserts thisMetricData
is a histogram that satisfies the provided assertion. -
hasExponentialHistogramSatisfying
public MetricAssert hasExponentialHistogramSatisfying(Consumer<ExponentialHistogramAssert> assertion) Asserts thisMetricData
is an exponential histogram that satisfies the provided assertion.- Since:
- 1.23.0
-
hasSummarySatisfying
Asserts thisMetricData
is a summary that satisfies the provided assertion.
-