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
  • Method Details

    • hasResource

      public MetricAssert hasResource(io.opentelemetry.sdk.resources.Resource resource)
      Asserts the metric has the given Resource.
    • hasResourceSatisfying

      public MetricAssert hasResourceSatisfying(Consumer<ResourceAssert> resource)
      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 the InstrumentationScopeInfo.
    • hasName

      public MetricAssert hasName(String name)
      Asserts the metric has the given name.
    • hasDescription

      public MetricAssert hasDescription(String description)
      Asserts the metric has the given description.
    • hasUnit

      public MetricAssert hasUnit(String unit)
      Asserts the metric has the given unit.
    • hasDoubleGaugeSatisfying

      public MetricAssert hasDoubleGaugeSatisfying(Consumer<DoubleGaugeAssert> assertion)
      Asserts this MetricData is a DoubleGauge that satisfies the provided assertion.
    • hasDoubleGaugePointsSatisfying

      @SafeVarargs public final MetricAssert hasDoubleGaugePointsSatisfying(Consumer<DoublePointAssert>... assertions)
      Asserts this MetricData is 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 this MetricData is a double gauge with points matching all of the given assertions and no more, in any order.
      Since:
      1.68.0
    • hasLongGaugeSatisfying

      public MetricAssert hasLongGaugeSatisfying(Consumer<LongGaugeAssert> assertion)
      Asserts this MetricData is a LongGauge that satisfies the provided assertion.
    • hasLongGaugePointsSatisfying

      @SafeVarargs public final MetricAssert hasLongGaugePointsSatisfying(Consumer<LongPointAssert>... assertions)
      Asserts this MetricData is 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 this MetricData is a long gauge with points matching all of the given assertions and no more, in any order.
      Since:
      1.68.0
    • hasDoubleSumSatisfying

      public MetricAssert hasDoubleSumSatisfying(Consumer<DoubleSumAssert> assertion)
      Asserts this MetricData is a double sum that satisfies the provided assertion.
    • hasDoubleSumPointsSatisfying

      @SafeVarargs public final MetricAssert hasDoubleSumPointsSatisfying(Consumer<DoublePointAssert>... assertions)
      Asserts this MetricData is 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 this MetricData is a double sum with points matching all of the given assertions and no more, in any order.
      Since:
      1.68.0
    • hasLongSumSatisfying

      public MetricAssert hasLongSumSatisfying(Consumer<LongSumAssert> assertion)
      Asserts this MetricData is a long sum that satisfies the provided assertion.
    • hasLongSumPointsSatisfying

      @SafeVarargs public final MetricAssert hasLongSumPointsSatisfying(Consumer<LongPointAssert>... assertions)
      Asserts this MetricData is 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 this MetricData is a long sum with points matching all of the given assertions and no more, in any order.
      Since:
      1.68.0
    • hasHistogramSatisfying

      public MetricAssert hasHistogramSatisfying(Consumer<HistogramAssert> assertion)
      Asserts this MetricData is a histogram that satisfies the provided assertion.
    • hasHistogramPointsSatisfying

      @SafeVarargs public final MetricAssert hasHistogramPointsSatisfying(Consumer<HistogramPointAssert>... assertions)
      Asserts this MetricData is 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 this MetricData is 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 this MetricData is an exponential histogram that satisfies the provided assertion.
      Since:
      1.23.0
    • hasExponentialHistogramPointsSatisfying

      @SafeVarargs public final MetricAssert hasExponentialHistogramPointsSatisfying(Consumer<ExponentialHistogramPointAssert>... assertions)
      Asserts this MetricData is 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 this MetricData is an exponential histogram with points matching all of the given assertions and no more, in any order.
      Since:
      1.68.0
    • hasSummarySatisfying

      public MetricAssert hasSummarySatisfying(Consumer<SummaryAssert> assertion)
      Asserts this MetricData is a summary that satisfies the provided assertion.
    • hasSummaryPointsSatisfying

      @SafeVarargs public final MetricAssert hasSummaryPointsSatisfying(Consumer<SummaryPointAssert>... assertions)
      Asserts this MetricData is 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 this MetricData is a summary with points matching all of the given assertions and no more, in any order.
      Since:
      1.68.0