Remove dependency on JUnit 4

Closes gh-1879
This commit is contained in:
Eleftheria Stein
2021-11-01 10:37:18 +01:00
parent 2110ef0c2d
commit 23882acf97
14 changed files with 38 additions and 21 deletions

View File

@@ -10,7 +10,9 @@ repositories {
}
dependencies {
testCompile 'junit:junit:4.12'
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
integrationTestCompile 'org.springframework:spring-core:4.3.7.RELEASE'
}
}

View File

@@ -9,6 +9,8 @@ repositories {
}
dependencies {
testCompile 'junit:junit:4.12'
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
integrationTestCompile 'org.springframework:spring-core:4.3.7.RELEASE'
}

View File

@@ -1,6 +1,6 @@
package sample;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.core.Ordered;
public class TheTest {

View File

@@ -10,5 +10,7 @@ repositories {
dependencies {
optional 'javax.servlet:javax.servlet-api:3.1.0'
testCompile 'junit:junit:4.12'
}
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
}

View File

@@ -1,6 +1,6 @@
package sample;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import javax.servlet.http.HttpServletRequest;
public class TheTest {

View File

@@ -9,5 +9,7 @@ repositories {
}
dependencies {
testCompile 'junit:junit:4.12'
}
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
}

View File

@@ -1,19 +1,19 @@
package sample;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class TheClassTest {
TheClass theClass = new TheClass();
@Test
public void doStuffWhenTrueThenTrue() {
assertTrue(theClass.doStuff(true));
assertThat(theClass.doStuff(true)).isTrue();
}
@Test
public void doStuffWhenTrueThenFalse() {
assertFalse(theClass.doStuff(false));
assertThat(theClass.doStuff(false)).isFalse();
}
}

View File

@@ -7,6 +7,8 @@ repositories {
}
dependencies {
testCompile 'junit:junit:4.12'
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
compile 'org.springframework:spring-core'
}

View File

@@ -9,6 +9,8 @@ repositories {
}
dependencies {
testCompile 'junit:junit:4.12'
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
optional 'aopalliance:aopalliance:1.0'
}

View File

@@ -11,6 +11,8 @@ repositories {
}
dependencies {
testCompile 'junit:junit:4.12'
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
optional 'aopalliance:aopalliance:1.0'
}

View File

@@ -7,7 +7,9 @@ repositories {
}
dependencies {
testCompile 'junit:junit:4.12'
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
optional 'aopalliance:aopalliance:1.0'
}

View File

@@ -6,5 +6,7 @@ repositories {
dependencies {
testImplementation project(path: ':core', configuration: 'tests')
testImplementation 'junit:junit:4.12'
}
testImplementation platform('org.junit:junit-bom:5.8.1')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
}

View File

@@ -1,6 +1,6 @@
package sample;
import org.junit.*;
import org.junit.jupiter.api.Test;
public class DependencyTest {
@Test

View File

@@ -27,7 +27,6 @@ dependencyManagement {
dependency 'io.lettuce:lettuce-core:6.1.5.RELEASE'
dependency 'javax.annotation:javax.annotation-api:1.3.2'
dependency 'javax.servlet:javax.servlet-api:4.0.1'
dependency 'junit:junit:4.13.2'
dependency 'mysql:mysql-connector-java:8.0.26'
dependency 'org.apache.derby:derby:10.14.2.0'
dependency 'org.assertj:assertj-core:3.21.0'