Add containsEntry overload that accepts int (#3412)
This commit is contained in:
parent
e4c03453eb
commit
d4bbaf405d
|
@ -1,4 +1,7 @@
|
|||
Comparing source compatibility of against
|
||||
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.testing.assertj.AttributesAssert (not serializable)
|
||||
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.AttributesAssert containsEntry(io.opentelemetry.api.common.AttributeKey, int)
|
||||
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.testing.assertj.SpanDataAssert (not serializable)
|
||||
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.SpanDataAssert hasException(java.lang.Throwable)
|
||||
|
|
|
@ -38,6 +38,11 @@ public final class AttributesAssert extends AbstractAssert<AttributesAssert, Att
|
|||
return this;
|
||||
}
|
||||
|
||||
/** Asserts the attributes have the given key and value. */
|
||||
public AttributesAssert containsEntry(AttributeKey<Long> key, int value) {
|
||||
return containsEntry(key, (long) value);
|
||||
}
|
||||
|
||||
/** Asserts the attributes have the given key and string value. */
|
||||
public AttributesAssert containsEntry(String key, String value) {
|
||||
return containsEntry(AttributeKey.stringKey(key), value);
|
||||
|
|
|
@ -146,6 +146,8 @@ class OpenTelemetryAssertionsTest {
|
|||
.containsEntry("bear", "mya")
|
||||
.containsEntry("warm", true)
|
||||
.containsEntry("temperature", 30)
|
||||
.containsEntry(AttributeKey.longKey("temperature"), 30L)
|
||||
.containsEntry(AttributeKey.longKey("temperature"), 30)
|
||||
.containsEntry("length", 1.2)
|
||||
.containsEntry("colors", "red", "blue")
|
||||
.containsEntryWithStringValuesOf("colors", Arrays.asList("red", "blue"))
|
||||
|
|
Loading…
Reference in New Issue