Merge pull request #12150 from anuragkumawat/JAVA-11777

JAVA-11777 Remove usage of deprecated JUnitPlatform.class in junit5-migration module
This commit is contained in:
kwoyke 2022-05-06 13:44:58 +02:00 committed by GitHub
commit 072e09eee8
5 changed files with 7 additions and 15 deletions

View File

@ -22,7 +22,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.junit.platform</groupId> <groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId> <artifactId>junit-platform-suite</artifactId>
<version>${junit-platform.version}</version> <version>${junit-platform.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>

View File

@ -1,17 +1,14 @@
package com.baeldung.junit5; package com.baeldung.junit5;
import java.time.Duration;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
import java.time.Duration;
@Tag("annotations") @Tag("annotations")
@Tag("junit5") @Tag("junit5")
@RunWith(JUnitPlatform.class)
public class AnnotationTestExampleUnitTest { public class AnnotationTestExampleUnitTest {
@Test @Test
public void shouldRaiseAnException() throws Exception { public void shouldRaiseAnException() throws Exception {

View File

@ -2,10 +2,7 @@ package com.baeldung.junit5;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
@RunWith(JUnitPlatform.class)
@ExtendWith(TraceUnitExtension.class) @ExtendWith(TraceUnitExtension.class)
public class RuleExampleUnitTest { public class RuleExampleUnitTest {

View File

@ -1,10 +1,9 @@
package com.baeldung.junit5vstestng; package com.baeldung.junit5vstestng;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.platform.suite.api.SelectClasses; import org.junit.platform.suite.api.SelectClasses;
import org.junit.runner.RunWith; import org.junit.platform.suite.api.Suite;
@RunWith(JUnitPlatform.class) @Suite
@SelectClasses({Class1UnitTest.class, Class2UnitTest.class}) @SelectClasses({Class1UnitTest.class, Class2UnitTest.class})
public class SelectClassesSuiteUnitTest { public class SelectClassesSuiteUnitTest {

View File

@ -1,10 +1,9 @@
package com.baeldung.junit5vstestng; package com.baeldung.junit5vstestng;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.SelectPackages;
import org.junit.runner.RunWith; import org.junit.platform.suite.api.Suite;
@RunWith(JUnitPlatform.class) @Suite
@SelectPackages({ "com.baeldung.java.suite.childpackage1", "com.baeldung.java.suite.childpackage2" }) @SelectPackages({ "com.baeldung.java.suite.childpackage1", "com.baeldung.java.suite.childpackage2" })
public class SelectPackagesSuiteUnitTest { public class SelectPackagesSuiteUnitTest {