assertThat(T, Matcher<? super T>) Deprecated. Use org.hamcrest.MatcherAssert.assertThat()
package com.baeldung.junit5vsjunit4assertions;
+import org.hamcrest.MatcherAssert;
import org.junit.Test;
import java.util.Arrays;
@@ -95,7 +96,7 @@ public class Junit4AssertionsUnitTest {
@Test
public void testAssertThatHasItems() {
- assertThat(Arrays.asList("Java", "Kotlin", "Scala"), hasItems("Java", "Kotlin"));
+ MatcherAssert.assertThat(Arrays.asList("Java", "Kotlin", "Scala"), hasItems("Java", "Kotlin"));
}
}
