Merge pull request #15163 from hmdrzsharifi/BAEL-7157
BAEL-7157: Introduce @SelectMethod for Selecting Methods in @Suite Classes in Junit
This commit is contained in:
commit
0db917b0ce
@ -45,7 +45,18 @@
|
||||
<version>${junit-platform.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-launcher</artifactId>
|
||||
<version>${junit-platform.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-commons</artifactId>
|
||||
<version>${junit-platform.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@ -70,7 +81,7 @@
|
||||
<properties>
|
||||
<jmockit.version>1.49</jmockit.version>
|
||||
<assertj.version>3.24.2</assertj.version>
|
||||
<junit-platform.version>1.9.2</junit-platform.version>
|
||||
<junit-platform.version>1.10.1</junit-platform.version>
|
||||
<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
|
||||
</properties>
|
||||
|
||||
|
@ -10,4 +10,8 @@ public class ClassOneUnitTest {
|
||||
Assertions.assertTrue(true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenFalse_thenFalse() {
|
||||
Assertions.assertFalse(false);
|
||||
}
|
||||
}
|
||||
|
@ -8,4 +8,9 @@ public class ClassTwoUnitTest {
|
||||
public void whenTrue_thenTrue() {
|
||||
Assertions.assertTrue(true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenFalse_thenFalse() {
|
||||
Assertions.assertFalse(false);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
package com.baeldung.testsuite.suites;
|
||||
|
||||
import com.baeldung.testsuite.ClassOneUnitTest;
|
||||
import org.junit.platform.suite.api.SelectMethod;
|
||||
import org.junit.platform.suite.api.Suite;
|
||||
import org.junit.platform.suite.api.SuiteDisplayName;
|
||||
|
||||
@Suite
|
||||
@SuiteDisplayName("My Test Suite")
|
||||
@SelectMethod(type = ClassOneUnitTest.class, name = "whenFalse_thenFalse")
|
||||
@SelectMethod("com.baeldung.testsuite.subpackage.ClassTwoUnitTest#whenFalse_thenFalse")
|
||||
public class JUnitSelectMethodsSuite {
|
||||
// runs ClassOneUnitTest and ClassTwoUnitTest
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user