Browse Source

SONAR-21643 Add support for Junit5

tags/10.5.0.89998
Léo Geoffroy 2 months ago
parent
commit
2bfa1d5203

+ 7
- 0
build.gradle View File

@@ -356,6 +356,13 @@ subprojects {
dependency 'javax.servlet:javax.servlet-api:4.0.1'
dependency 'javax.xml.bind:jaxb-api:2.3.1'
dependency 'junit:junit:4.13.2'
// JUnit 5
dependencySet(group: 'org.junit.jupiter', version: '5.10.2') {
entry 'junit-jupiter-api'
entry 'junit-jupiter-engine'
entry 'junit-jupiter-params'
entry 'junit-vintage-engine'
}
dependency 'org.xmlunit:xmlunit-core:2.9.1'
dependency 'org.xmlunit:xmlunit-matchers:2.9.1'
dependency 'org.lz4:lz4-java:1.8.0'

+ 9
- 0
sonar-core/build.gradle View File

@@ -30,6 +30,7 @@ dependencies {
testImplementation 'com.tngtech.java:junit-dataprovider'
testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.hamcrest:hamcrest-core'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.simpleframework:simple'
@@ -37,6 +38,9 @@ dependencies {
testImplementation project(':sonar-testing-harness')

testCompileOnly 'com.google.code.findbugs:jsr305'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
}

// Used by sonar-db-core to run DB Unit Tests
@@ -52,3 +56,8 @@ publishing {
}
}
}

test {
// Enabling the JUnit Platform (see https://github.com/junit-team/junit5-samples/tree/master/junit5-migration-gradle)
useJUnitPlatform()
}

+ 1
- 1
sonar-core/src/test/java/org/sonar/classloader/MaskTest.java View File

@@ -19,7 +19,7 @@
*/
package org.sonar.classloader;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;


Loading…
Cancel
Save