|
2 | 2 |
|
3 | 3 | import com.fishercoder.common.classes.ListNode;
|
4 | 4 | import com.fishercoder.solutions._61;
|
5 |
| -import org.junit.BeforeClass; |
6 |
| -import org.junit.Test; |
| 5 | +import org.junit.jupiter.api.BeforeEach; |
| 6 | +import org.junit.jupiter.api.Test; |
7 | 7 |
|
8 |
| -import static junit.framework.Assert.assertEquals; |
| 8 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
9 | 9 |
|
10 | 10 | public class _61Test {
|
11 |
| - private static _61.Solution1 solution1; |
12 |
| - private static ListNode expected; |
13 |
| - private static ListNode actual; |
14 |
| - private static ListNode head; |
15 |
| - private static int k; |
| 11 | + private static _61.Solution1 solution1; |
| 12 | + private static ListNode expected; |
| 13 | + private static ListNode actual; |
| 14 | + private static ListNode head; |
| 15 | + private static int k; |
16 | 16 |
|
17 |
| - @BeforeClass |
18 |
| - public static void setup() { |
19 |
| - solution1 = new _61.Solution1(); |
20 |
| - } |
| 17 | + @BeforeEach |
| 18 | + public void setup() { |
| 19 | + solution1 = new _61.Solution1(); |
| 20 | + } |
21 | 21 |
|
22 |
| - @Test |
23 |
| - public void test1() { |
24 |
| - k = 2; |
25 |
| - expected = new ListNode(4); |
26 |
| - expected.next = new ListNode(5); |
27 |
| - expected.next.next = new ListNode(1); |
28 |
| - expected.next.next.next = new ListNode(2); |
29 |
| - expected.next.next.next.next = new ListNode(3); |
| 22 | + @Test |
| 23 | + public void test1() { |
| 24 | + k = 2; |
| 25 | + expected = new ListNode(4); |
| 26 | + expected.next = new ListNode(5); |
| 27 | + expected.next.next = new ListNode(1); |
| 28 | + expected.next.next.next = new ListNode(2); |
| 29 | + expected.next.next.next.next = new ListNode(3); |
30 | 30 |
|
31 |
| - head = new ListNode(1); |
32 |
| - head.next = new ListNode(2); |
33 |
| - head.next.next = new ListNode(3); |
34 |
| - head.next.next.next = new ListNode(4); |
35 |
| - head.next.next.next.next = new ListNode(5); |
| 31 | + head = new ListNode(1); |
| 32 | + head.next = new ListNode(2); |
| 33 | + head.next.next = new ListNode(3); |
| 34 | + head.next.next.next = new ListNode(4); |
| 35 | + head.next.next.next.next = new ListNode(5); |
36 | 36 |
|
37 |
| - actual = solution1.rotateRight(head, k); |
38 |
| - assertEquals(expected, actual); |
39 |
| - } |
| 37 | + actual = solution1.rotateRight(head, k); |
| 38 | + assertEquals(expected, actual); |
| 39 | + } |
40 | 40 | }
|
0 commit comments