Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public static AttributeAssertion satisfies(
* Returns an {@link AttributeAssertion} that asserts the given {@code key} is present with the
* given {@code value}.
*/
public static <T> AttributeAssertion equalTo(AttributeKey<T> key, T value) {
public static <T> AttributeAssertion equalTo(AttributeKey<T> key, @Nullable T value) {
return AttributeAssertion.create(key, val -> val.isEqualTo(value));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ void assertAttributesShouldNotThrowIfAllAttributesMatch() {
AssertUtil.assertAttributes(ATTRIBUTES, assertions);
}

@Test
void assertAttributesShouldNotThrowIfEqualToNullAndAttributeNotSet() {
List<AttributeAssertion> assertions = Arrays.asList(equalTo(WARM, null));

AssertUtil.assertAttributes(Attributes.empty(), assertions);
}

@Test
void assertAttributesExactlyShouldThrowIfNoAttributeMatch() {
List<AttributeAssertion> assertions = Arrays.asList(equalTo(WARM, false));
Expand Down
Loading