Skip to content

Commit d16893f

Browse files
committedJan 20, 2024
introduce Junit5
1 parent 4a49f4c commit d16893f

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed
 

‎build.gradle

+8-1
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,17 @@ dependencies {
3535
compile 'junit:junit:4.13'
3636
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.0'
3737
testCompile "junit:junit:4.13.1"
38-
testCompile("org.assertj:assertj-core:3.11.1")
3938

39+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
40+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
41+
42+
testCompile("org.assertj:assertj-core:3.11.1")
4043
compileOnly 'org.projectlombok:lombok:1.18.12'
4144
annotationProcessor 'org.projectlombok:lombok:1.18.12'
4245
testCompileOnly 'org.projectlombok:lombok:1.18.12'
4346
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
4447
}
48+
49+
test {
50+
useJUnitPlatform()
51+
}

‎src/test/java/com/fishercoder/_2716Test.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
package com.fishercoder;
22

33
import com.fishercoder.solutions._2716;
4-
import org.junit.BeforeClass;
5-
import org.junit.Test;
4+
import org.junit.jupiter.api.BeforeEach;
5+
import org.junit.jupiter.api.Test;
6+
7+
import static org.junit.jupiter.api.Assertions.assertEquals;
68

7-
import static org.junit.Assert.assertEquals;
89

910
public class _2716Test {
1011
private static _2716.Solution1 solution1;
1112

12-
@BeforeClass
13-
public static void setup() {
13+
@BeforeEach
14+
public void setup() {
1415
solution1 = new _2716.Solution1();
1516
}
1617

0 commit comments

Comments
 (0)
Please sign in to comment.