Skip to content

Commit 1473117

Browse files
migrate 61 to junit5
1 parent 7d53495 commit 1473117

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

Diff for: src/test/java/com/fishercoder/_61Test.java

+28-28
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22

33
import com.fishercoder.common.classes.ListNode;
44
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;
77

8-
import static junit.framework.Assert.assertEquals;
8+
import static org.junit.jupiter.api.Assertions.assertEquals;
99

1010
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;
1616

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+
}
2121

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);
3030

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);
3636

37-
actual = solution1.rotateRight(head, k);
38-
assertEquals(expected, actual);
39-
}
37+
actual = solution1.rotateRight(head, k);
38+
assertEquals(expected, actual);
39+
}
4040
}

0 commit comments

Comments
 (0)