diff --git a/testing-modules/junit5-migration/pom.xml b/testing-modules/junit5-migration/pom.xml index 3ea035c4f9..3720c1dc4a 100644 --- a/testing-modules/junit5-migration/pom.xml +++ b/testing-modules/junit5-migration/pom.xml @@ -22,7 +22,7 @@ org.junit.platform - junit-platform-runner + junit-platform-suite ${junit-platform.version} test diff --git a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5/AnnotationTestExampleUnitTest.java b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5/AnnotationTestExampleUnitTest.java index 16de0be9d8..52d8f8f60a 100644 --- a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5/AnnotationTestExampleUnitTest.java +++ b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5/AnnotationTestExampleUnitTest.java @@ -1,17 +1,14 @@ package com.baeldung.junit5; +import java.time.Duration; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import org.junit.platform.runner.JUnitPlatform; -import org.junit.runner.RunWith; - -import java.time.Duration; @Tag("annotations") @Tag("junit5") -@RunWith(JUnitPlatform.class) public class AnnotationTestExampleUnitTest { @Test public void shouldRaiseAnException() throws Exception { diff --git a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5/RuleExampleUnitTest.java b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5/RuleExampleUnitTest.java index 297d0f1730..df509f561a 100644 --- a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5/RuleExampleUnitTest.java +++ b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5/RuleExampleUnitTest.java @@ -2,10 +2,7 @@ package com.baeldung.junit5; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.platform.runner.JUnitPlatform; -import org.junit.runner.RunWith; -@RunWith(JUnitPlatform.class) @ExtendWith(TraceUnitExtension.class) public class RuleExampleUnitTest { diff --git a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java index 7b4bd746bf..f307a75274 100644 --- a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java +++ b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectClassesSuiteUnitTest.java @@ -1,10 +1,9 @@ package com.baeldung.junit5vstestng; -import org.junit.platform.runner.JUnitPlatform; 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}) public class SelectClassesSuiteUnitTest { diff --git a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java index 7378eafaa7..ef8756a2bb 100644 --- a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java +++ b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java @@ -1,10 +1,9 @@ package com.baeldung.junit5vstestng; -import org.junit.platform.runner.JUnitPlatform; 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" }) public class SelectPackagesSuiteUnitTest {