|
3 | 3 | import com.fishercoder.common.classes.ListNode;
|
4 | 4 | import com.fishercoder.common.utils.LinkedListUtils;
|
5 | 5 | import com.fishercoder.solutions._82;
|
6 |
| -import org.junit.Assert; |
7 |
| -import org.junit.BeforeClass; |
8 |
| -import org.junit.Test; |
| 6 | +import org.junit.jupiter.api.BeforeEach; |
| 7 | +import org.junit.jupiter.api.Test; |
| 8 | + |
| 9 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
9 | 10 |
|
10 | 11 | public class _82Test {
|
11 | 12 |
|
12 | 13 | private static _82.Solution1 solution1;
|
13 | 14 | private static ListNode head;
|
14 | 15 | private static ListNode expected;
|
15 | 16 |
|
16 |
| - @BeforeClass |
17 |
| - public static void setup() { |
| 17 | + @BeforeEach |
| 18 | + public void setup() { |
18 | 19 | solution1 = new _82.Solution1();
|
19 | 20 | }
|
20 | 21 |
|
21 | 22 | @Test
|
22 | 23 | public void test1() {
|
23 | 24 | head = LinkedListUtils.contructLinkedList(new int[]{1, 2, 3, 3, 4, 4, 5});
|
24 | 25 | expected = LinkedListUtils.contructLinkedList(new int[]{1, 2, 5});
|
25 |
| - Assert.assertEquals(expected, solution1.deleteDuplicates(head)); |
| 26 | + assertEquals(expected, solution1.deleteDuplicates(head)); |
26 | 27 | }
|
27 | 28 |
|
28 | 29 | @Test
|
29 | 30 | public void test2() {
|
30 | 31 | head = LinkedListUtils.contructLinkedList(new int[]{1, 1, 1, 2, 3});
|
31 | 32 | expected = LinkedListUtils.contructLinkedList(new int[]{2, 3});
|
32 |
| - Assert.assertEquals(expected, solution1.deleteDuplicates(head)); |
| 33 | + assertEquals(expected, solution1.deleteDuplicates(head)); |
33 | 34 | }
|
34 | 35 | }
|
0 commit comments