File tree Expand file tree Collapse file tree
main/java/io/opentelemetry/sdk/testing/assertj
test/java/io/opentelemetry/sdk/testing/assertj Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ public static AttributeAssertion satisfies(
240240 * Returns an {@link AttributeAssertion} that asserts the given {@code key} is present with the
241241 * given {@code value}.
242242 */
243- public static <T > AttributeAssertion equalTo (AttributeKey <T > key , T value ) {
243+ public static <T > AttributeAssertion equalTo (AttributeKey <T > key , @ Nullable T value ) {
244244 return AttributeAssertion .create (key , val -> val .isEqualTo (value ));
245245 }
246246
Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ void assertAttributesShouldNotThrowIfAllAttributesMatch() {
5959 AssertUtil .assertAttributes (ATTRIBUTES , assertions );
6060 }
6161
62+ @ Test
63+ void assertAttributesShouldNotThrowIfEqualToNullAndAttributeNotSet () {
64+ List <AttributeAssertion > assertions = Arrays .asList (equalTo (WARM , null ));
65+
66+ AssertUtil .assertAttributes (Attributes .empty (), assertions );
67+ }
68+
6269 @ Test
6370 void assertAttributesExactlyShouldThrowIfNoAttributeMatch () {
6471 List <AttributeAssertion > assertions = Arrays .asList (equalTo (WARM , false ));
You can’t perform that action at this time.
0 commit comments