BAEL-6818 Use JUnit assertions

This commit is contained in:
Sam Gardner 2023-08-16 12:02:58 +01:00
parent 960fe5312e
commit dda2970e52
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,7 @@
package com.baeldung.checkforkey;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Objects;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
@ -26,7 +28,7 @@ public class CheckForKeyUnitTest {
boolean result = s.map(entry -> entry.get("colour"))
.filter(Objects::nonNull)
.anyMatch(colour -> "green".equals(colour.asText()));
assert (result);
assertTrue(result);
}
@Test
@ -39,7 +41,7 @@ public class CheckForKeyUnitTest {
.get("colour"))
.filter(Objects::nonNull)
.anyMatch(colour -> "green".equals(colour.getAsString()));
assert (result);
assertTrue(result);
}
}