Class LogRecordDataAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<LogRecordDataAssert,io.opentelemetry.sdk.logs.data.LogRecordData>
io.opentelemetry.sdk.testing.assertj.LogRecordDataAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<LogRecordDataAssert,io.opentelemetry.sdk.logs.data.LogRecordData>, org.assertj.core.api.Descriptable<LogRecordDataAssert>, org.assertj.core.api.ExtensionPoints<LogRecordDataAssert,io.opentelemetry.sdk.logs.data.LogRecordData>

public final class LogRecordDataAssert extends org.assertj.core.api.AbstractAssert<LogRecordDataAssert,io.opentelemetry.sdk.logs.data.LogRecordData>
Test assertions for LogRecordData.
Since:
1.27.0
  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Method Summary

    Modifier and Type
    Method
    Description
    hasAttributes(io.opentelemetry.api.common.Attributes attributes)
    Asserts the log has the given attributes.
    hasAttributes(Map.Entry<? extends io.opentelemetry.api.common.AttributeKey<?>,?>... entries)
    Asserts the log has the given attributes.
    Asserts the log has attributes matching all assertions.
    Asserts the log has attributes matching all assertions.
    hasAttributesSatisfying(Consumer<io.opentelemetry.api.common.Attributes> attributes)
    Asserts the log has attributes satisfying the given condition.
    Asserts the log has attributes matching all assertions and no more.
    Asserts the log has attributes matching all assertions and no more.
    hasBody(io.opentelemetry.api.common.Value<?> body)
    Asserts the log has the given body.
    Asserts the log has the given body.
    hasBodyField(io.opentelemetry.api.common.AttributeKey<T> key, T value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given attribute key and value.
    hasBodyField(String key, boolean value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and boolean value.
    hasBodyField(String key, boolean... value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and list of boolean values.
    hasBodyField(String key, double value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and double value.
    hasBodyField(String key, double... value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and list of double values.
    hasBodyField(String key, long value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and long value.
    hasBodyField(String key, long... value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and list of long values.
    hasBodyField(String key, io.opentelemetry.api.common.Value<?> value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and value.
    hasBodyField(String key, String value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and String value.
    hasBodyField(String key, String... value)
    Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and list of String values.
    hasInstrumentationScope(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo)
    Asserts the InstrumentationScopeInfo associated with a log matches the expected value.
    hasObservedTimestamp(long observedEpochNanos)
    Asserts the log has the given epoch observedTimestamp.
    hasResource(io.opentelemetry.sdk.resources.Resource resource)
    Asserts the Resource associated with a log matches the expected value.
    Asserts the log has a resource satisfying the given condition.
    hasSeverity(io.opentelemetry.api.logs.Severity severity)
    Asserts the log has the given severity.
    hasSeverityText(String severityText)
    Asserts the log has the given severity text.
    hasSpanContext(io.opentelemetry.api.trace.SpanContext spanContext)
    Asserts the log has the given span context.
    hasTimestamp(long timestampEpochNanos)
    Asserts the log has the given epoch timestamp.
    hasTotalAttributeCount(int totalAttributeCount)
    Asserts the log has the given total attributes.

    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, 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

      public LogRecordDataAssert hasResource(io.opentelemetry.sdk.resources.Resource resource)
      Asserts the Resource associated with a log matches the expected value.
    • hasResourceSatisfying

      public LogRecordDataAssert hasResourceSatisfying(Consumer<ResourceAssert> resource)
      Asserts the log has a resource satisfying the given condition.
      Since:
      1.29.0
    • hasInstrumentationScope

      public LogRecordDataAssert hasInstrumentationScope(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo)
      Asserts the InstrumentationScopeInfo associated with a log matches the expected value.
    • hasTimestamp

      public LogRecordDataAssert hasTimestamp(long timestampEpochNanos)
      Asserts the log has the given epoch timestamp.
    • hasObservedTimestamp

      public LogRecordDataAssert hasObservedTimestamp(long observedEpochNanos)
      Asserts the log has the given epoch observedTimestamp.
    • hasSpanContext

      public LogRecordDataAssert hasSpanContext(io.opentelemetry.api.trace.SpanContext spanContext)
      Asserts the log has the given span context.
    • hasSeverity

      public LogRecordDataAssert hasSeverity(io.opentelemetry.api.logs.Severity severity)
      Asserts the log has the given severity.
    • hasSeverityText

      public LogRecordDataAssert hasSeverityText(String severityText)
      Asserts the log has the given severity text.
    • hasBody

      public LogRecordDataAssert hasBody(String body)
      Asserts the log has the given body.
    • hasBody

      public LogRecordDataAssert hasBody(@Nullable io.opentelemetry.api.common.Value<?> body)
      Asserts the log has the given body.
      Since:
      1.42.0
    • hasBodyField

      public LogRecordDataAssert hasBodyField(String key, String value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and String value.
      Since:
      1.42.0
    • hasBodyField

      public LogRecordDataAssert hasBodyField(String key, long value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and long value.
      Since:
      1.42.0
    • hasBodyField

      public LogRecordDataAssert hasBodyField(String key, double value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and double value.
      Since:
      1.42.0
    • hasBodyField

      public LogRecordDataAssert hasBodyField(String key, boolean value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and boolean value.
      Since:
      1.42.0
    • hasBodyField

      public LogRecordDataAssert hasBodyField(String key, String... value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and list of String values.
      Since:
      1.42.0
    • hasBodyField

      public LogRecordDataAssert hasBodyField(String key, long... value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and list of long values.
      Since:
      1.42.0
    • hasBodyField

      public LogRecordDataAssert hasBodyField(String key, double... value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and list of double values.
      Since:
      1.42.0
    • hasBodyField

      public LogRecordDataAssert hasBodyField(String key, boolean... value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and list of boolean values.
      Since:
      1.42.0
    • hasBodyField

      public LogRecordDataAssert hasBodyField(String key, io.opentelemetry.api.common.Value<?> value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given key and value.
      Since:
      1.42.0
    • hasBodyField

      public <T> LogRecordDataAssert hasBodyField(io.opentelemetry.api.common.AttributeKey<T> key, T value)
      Asserts the log has a body of type ValueType.KEY_VALUE_LIST, containing a field with the given attribute key and value.
      Since:
      1.42.0
    • hasAttributes

      public LogRecordDataAssert hasAttributes(io.opentelemetry.api.common.Attributes attributes)
      Asserts the log has the given attributes.
    • hasAttributes

      @SafeVarargs public final LogRecordDataAssert hasAttributes(Map.Entry<? extends io.opentelemetry.api.common.AttributeKey<?>,?>... entries)
      Asserts the log has the given attributes.
    • hasAttributesSatisfying

      public LogRecordDataAssert hasAttributesSatisfying(Consumer<io.opentelemetry.api.common.Attributes> attributes)
      Asserts the log has attributes satisfying the given condition.
    • hasAttributesSatisfying

      public LogRecordDataAssert hasAttributesSatisfying(AttributeAssertion... assertions)
      Asserts the log has attributes matching all assertions. Assertions can be created using methods like OpenTelemetryAssertions.satisfies(AttributeKey, OpenTelemetryAssertions.LongAssertConsumer).
    • hasAttributesSatisfying

      public LogRecordDataAssert hasAttributesSatisfying(Iterable<AttributeAssertion> assertions)
      Asserts the log has attributes matching all assertions. Assertions can be created using methods like OpenTelemetryAssertions.satisfies(AttributeKey, OpenTelemetryAssertions.LongAssertConsumer).
    • hasAttributesSatisfyingExactly

      public LogRecordDataAssert hasAttributesSatisfyingExactly(AttributeAssertion... assertions)
      Asserts the log has attributes matching all assertions and no more. Assertions can be created using methods like OpenTelemetryAssertions.satisfies(AttributeKey, OpenTelemetryAssertions.LongAssertConsumer).
    • hasAttributesSatisfyingExactly

      public LogRecordDataAssert hasAttributesSatisfyingExactly(Iterable<AttributeAssertion> assertions)
      Asserts the log has attributes matching all assertions and no more. Assertions can be created using methods like OpenTelemetryAssertions.satisfies(AttributeKey, OpenTelemetryAssertions.LongAssertConsumer).
    • hasTotalAttributeCount

      public LogRecordDataAssert hasTotalAttributeCount(int totalAttributeCount)
      Asserts the log has the given total attributes.