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.hasDoubleGaugePointsSatisfying(Iterable<? extends Consumer<DoublePointAssert>> assertions) Asserts thisMetricDatais a double gauge with points matching all of the given assertions and no more, in any order.final MetricAsserthasDoubleGaugePointsSatisfying(Consumer<DoublePointAssert>... assertions) Asserts thisMetricDatais a double gauge with points matching all of the given assertions and no more, in any order.hasDoubleGaugeSatisfying(Consumer<DoubleGaugeAssert> assertion) Asserts thisMetricDatais aDoubleGaugethat satisfies the provided assertion.hasDoubleSumPointsSatisfying(Iterable<? extends Consumer<DoublePointAssert>> assertions) Asserts thisMetricDatais a double sum with points matching all of the given assertions and no more, in any order.final MetricAsserthasDoubleSumPointsSatisfying(Consumer<DoublePointAssert>... assertions) Asserts thisMetricDatais a double sum with points matching all of the given assertions and no more, in any order.hasDoubleSumSatisfying(Consumer<DoubleSumAssert> assertion) Asserts thisMetricDatais a double sum that satisfies the provided assertion.hasExponentialHistogramPointsSatisfying(Iterable<? extends Consumer<ExponentialHistogramPointAssert>> assertions) Asserts thisMetricDatais an exponential histogram with points matching all of the given assertions and no more, in any order.final MetricAssertAsserts thisMetricDatais an exponential histogram with points matching all of the given assertions and no more, in any order.Asserts thisMetricDatais an exponential histogram that satisfies the provided assertion.hasHistogramPointsSatisfying(Iterable<? extends Consumer<HistogramPointAssert>> assertions) Asserts thisMetricDatais a histogram with points matching all of the given assertions and no more, in any order.final MetricAsserthasHistogramPointsSatisfying(Consumer<HistogramPointAssert>... assertions) Asserts thisMetricDatais a histogram with points matching all of the given assertions and no more, in any order.hasHistogramSatisfying(Consumer<HistogramAssert> assertion) Asserts thisMetricDatais a histogram that satisfies the provided assertion.hasInstrumentationScope(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo) Asserts the metric has the given theInstrumentationScopeInfo.hasLongGaugePointsSatisfying(Iterable<? extends Consumer<LongPointAssert>> assertions) Asserts thisMetricDatais a long gauge with points matching all of the given assertions and no more, in any order.final MetricAsserthasLongGaugePointsSatisfying(Consumer<LongPointAssert>... assertions) Asserts thisMetricDatais a long gauge with points matching all of the given assertions and no more, in any order.hasLongGaugeSatisfying(Consumer<LongGaugeAssert> assertion) Asserts thisMetricDatais aLongGaugethat satisfies the provided assertion.hasLongSumPointsSatisfying(Iterable<? extends Consumer<LongPointAssert>> assertions) Asserts thisMetricDatais a long sum with points matching all of the given assertions and no more, in any order.final MetricAsserthasLongSumPointsSatisfying(Consumer<LongPointAssert>... assertions) Asserts thisMetricDatais a long sum with points matching all of the given assertions and no more, in any order.hasLongSumSatisfying(Consumer<LongSumAssert> assertion) Asserts thisMetricDatais 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.hasSummaryPointsSatisfying(Iterable<? extends Consumer<SummaryPointAssert>> assertions) Asserts thisMetricDatais a summary with points matching all of the given assertions and no more, in any order.final MetricAsserthasSummaryPointsSatisfying(Consumer<SummaryPointAssert>... assertions) Asserts thisMetricDatais a summary with points matching all of the given assertions and no more, in any order.hasSummarySatisfying(Consumer<SummaryAssert> assertion) Asserts thisMetricDatais a summary that satisfies the provided assertion.Asserts the metric has the given unit.Methods inherited from class org.assertj.core.api.AbstractAssert
actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, 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, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnErrorMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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 thisMetricDatais aDoubleGaugethat satisfies the provided assertion. -
hasDoubleGaugePointsSatisfying
@SafeVarargs public final MetricAssert hasDoubleGaugePointsSatisfying(Consumer<DoublePointAssert>... assertions) Asserts thisMetricDatais a double gauge with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasDoubleGaugePointsSatisfying
public MetricAssert hasDoubleGaugePointsSatisfying(Iterable<? extends Consumer<DoublePointAssert>> assertions) Asserts thisMetricDatais a double gauge with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasLongGaugeSatisfying
Asserts thisMetricDatais aLongGaugethat satisfies the provided assertion. -
hasLongGaugePointsSatisfying
@SafeVarargs public final MetricAssert hasLongGaugePointsSatisfying(Consumer<LongPointAssert>... assertions) Asserts thisMetricDatais a long gauge with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasLongGaugePointsSatisfying
public MetricAssert hasLongGaugePointsSatisfying(Iterable<? extends Consumer<LongPointAssert>> assertions) Asserts thisMetricDatais a long gauge with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasDoubleSumSatisfying
Asserts thisMetricDatais a double sum that satisfies the provided assertion. -
hasDoubleSumPointsSatisfying
@SafeVarargs public final MetricAssert hasDoubleSumPointsSatisfying(Consumer<DoublePointAssert>... assertions) Asserts thisMetricDatais a double sum with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasDoubleSumPointsSatisfying
public MetricAssert hasDoubleSumPointsSatisfying(Iterable<? extends Consumer<DoublePointAssert>> assertions) Asserts thisMetricDatais a double sum with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasLongSumSatisfying
Asserts thisMetricDatais a long sum that satisfies the provided assertion. -
hasLongSumPointsSatisfying
@SafeVarargs public final MetricAssert hasLongSumPointsSatisfying(Consumer<LongPointAssert>... assertions) Asserts thisMetricDatais a long sum with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasLongSumPointsSatisfying
public MetricAssert hasLongSumPointsSatisfying(Iterable<? extends Consumer<LongPointAssert>> assertions) Asserts thisMetricDatais a long sum with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasHistogramSatisfying
Asserts thisMetricDatais a histogram that satisfies the provided assertion. -
hasHistogramPointsSatisfying
@SafeVarargs public final MetricAssert hasHistogramPointsSatisfying(Consumer<HistogramPointAssert>... assertions) Asserts thisMetricDatais a histogram with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasHistogramPointsSatisfying
public MetricAssert hasHistogramPointsSatisfying(Iterable<? extends Consumer<HistogramPointAssert>> assertions) Asserts thisMetricDatais a histogram with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasExponentialHistogramSatisfying
public MetricAssert hasExponentialHistogramSatisfying(Consumer<ExponentialHistogramAssert> assertion) Asserts thisMetricDatais an exponential histogram that satisfies the provided assertion.- Since:
- 1.23.0
-
hasExponentialHistogramPointsSatisfying
@SafeVarargs public final MetricAssert hasExponentialHistogramPointsSatisfying(Consumer<ExponentialHistogramPointAssert>... assertions) Asserts thisMetricDatais an exponential histogram with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasExponentialHistogramPointsSatisfying
public MetricAssert hasExponentialHistogramPointsSatisfying(Iterable<? extends Consumer<ExponentialHistogramPointAssert>> assertions) Asserts thisMetricDatais an exponential histogram with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasSummarySatisfying
Asserts thisMetricDatais a summary that satisfies the provided assertion. -
hasSummaryPointsSatisfying
@SafeVarargs public final MetricAssert hasSummaryPointsSatisfying(Consumer<SummaryPointAssert>... assertions) Asserts thisMetricDatais a summary with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-
hasSummaryPointsSatisfying
public MetricAssert hasSummaryPointsSatisfying(Iterable<? extends Consumer<SummaryPointAssert>> assertions) Asserts thisMetricDatais a summary with points matching all of the given assertions and no more, in any order.- Since:
- 1.68.0
-