assertThat(T, Matcher<? super T>) Deprecated. Use org.hamcrest.MatcherAssert.assertThat()
This commit is contained in:
parent
4bcb36ff41
commit
7d343f7674
|
@ -1,5 +1,6 @@
|
|||
package com.baeldung.junit5vsjunit4assertions;
|
||||
|
||||
import org.hamcrest.MatcherAssert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -30,7 +31,7 @@ public class Junit4AssertionsUnitTest {
|
|||
|
||||
@Test
|
||||
public void whenAssertingArraysEquality_thenEqual() {
|
||||
char[] expected = { 'J', 'u', 'n', 'i', 't' };
|
||||
char[] expected = {'J', 'u', 'n', 'i', 't'};
|
||||
char[] actual = "Junit".toCharArray();
|
||||
|
||||
assertArrayEquals(expected, actual);
|
||||
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue