Class AttributesAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<AttributesAssert,io.opentelemetry.api.common.Attributes>
io.opentelemetry.sdk.testing.assertj.AttributesAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<AttributesAssert,io.opentelemetry.api.common.Attributes>, org.assertj.core.api.Descriptable<AttributesAssert>, org.assertj.core.api.ExtensionPoints<AttributesAssert,io.opentelemetry.api.common.Attributes>

public final class AttributesAssert extends org.assertj.core.api.AbstractAssert<AttributesAssert,io.opentelemetry.api.common.Attributes>
Assertions for Attributes.
  • Method Details

    • containsEntry

      public <T> AttributesAssert containsEntry(io.opentelemetry.api.common.AttributeKey<T> key, T value)
      Asserts the attributes have the given key and value.
    • containsEntry

      public AttributesAssert containsEntry(io.opentelemetry.api.common.AttributeKey<Long> key, int value)
      Asserts the attributes have the given key and value.
    • containsEntry

      public AttributesAssert containsEntry(String key, String value)
      Asserts the attributes have the given key and string value.
    • containsEntry

      public AttributesAssert containsEntry(String key, boolean value)
      Asserts the attributes have the given key and boolean value.
    • containsEntry

      public AttributesAssert containsEntry(String key, long value)
      Asserts the attributes have the given key and long value.
    • containsEntry

      public AttributesAssert containsEntry(String key, double value)
      Asserts the attributes have the given key and double value.
    • containsEntry

      public AttributesAssert containsEntry(String key, String... value)
      Asserts the attributes have the given key and string array value.
    • containsEntry

      public AttributesAssert containsEntry(String key, Boolean... value)
      Asserts the attributes have the given key and boolean array value.
    • containsEntry

      public AttributesAssert containsEntry(String key, Long... value)
      Asserts the attributes have the given key and long array value.
    • containsEntry

      public AttributesAssert containsEntry(String key, Double... value)
      Asserts the attributes have the given key and double array value.
    • containsEntryWithStringValuesOf

      public AttributesAssert containsEntryWithStringValuesOf(String key, Iterable<String> value)
      Asserts the attributes have the given key and string array value.
    • containsEntryWithBooleanValuesOf

      public AttributesAssert containsEntryWithBooleanValuesOf(String key, Iterable<Boolean> value)
      Asserts the attributes have the given key and boolean array value.
    • containsEntryWithLongValuesOf

      public AttributesAssert containsEntryWithLongValuesOf(String key, Iterable<Long> value)
      Asserts the attributes have the given key and long array value.
    • containsEntryWithDoubleValuesOf

      public AttributesAssert containsEntryWithDoubleValuesOf(String key, Iterable<Double> value)
      Asserts the attributes have the given key and double array value.
    • hasEntrySatisfying

      public <T> AttributesAssert hasEntrySatisfying(io.opentelemetry.api.common.AttributeKey<T> key, Consumer<T> valueCondition)
      Asserts the attributes have the given key with a value satisfying the given condition.
    • containsOnly

      @SafeVarargs public final AttributesAssert containsOnly(Map.Entry<? extends io.opentelemetry.api.common.AttributeKey<?>,?>... entries)
      Asserts the attributes only contain the given entries.
    • containsKey

      public AttributesAssert containsKey(io.opentelemetry.api.common.AttributeKey<?> key)
      Asserts the attributes contain the given key.
    • containsKey

      public AttributesAssert containsKey(String key)
      Asserts the attributes contain the given key.
    • doesNotContainKey

      public AttributesAssert doesNotContainKey(io.opentelemetry.api.common.AttributeKey<?> key)
      Asserts the attributes do not contain the given key.
      Since:
      1.18.0
    • doesNotContainKey

      public AttributesAssert doesNotContainKey(String key)
      Asserts the attributes do not contain the given key.
      Since:
      1.18.0
    • isEmpty

      public AttributesAssert isEmpty()
      Asserts the attributes have no entries.
    • hasSize

      public AttributesAssert hasSize(int numberOfEntries)
      Asserts the number of attributes in the collection.