Package org.approvej.approve
Interface TestMethod
- All Known Implementing Classes:
TestMethod.JUnitTestMethod
,TestMethod.SpockTestMethod
,TestMethod.TestNGTestMethod
@NullMarked
public interface TestMethod
Represents a test method in a test class. This interface provides a way to identify and work with
test methods across different testing frameworks.
Implementations of this interface are provided for JUnit, TestNG, and Spock.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
TestMethod
implementation for JUnit/JUnit5.static final record
TestMethod
implementation for Spock.static final record
TestMethod
implementation for TestNG. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional
<TestMethod> Tries to create aTestMethod
from the givenMethod
.method()
Returns theMethod
of the test case.Returns all test relatedAnnotation
s of theTestMethod
.Returns the name of the test case.Class
<?> Returns theClass
of theTestMethod
.
-
Method Details
-
create
Tries to create aTestMethod
from the givenMethod
.- Parameters:
method
- the potential testMethod
- Returns:
- an
Optional
containing theTestMethod
if theMethod
is a test case.
-
method
Method method()Returns theMethod
of the test case.- Returns:
- the
Method
of the test case
-
testCaseName
String testCaseName()Returns the name of the test case.- Returns:
- the name of test case
-
testClass
Class<?> testClass()Returns theClass
of theTestMethod
.- Returns:
- the
Class
of theTestMethod
-
testAnnotations
List<Annotation> testAnnotations()Returns all test relatedAnnotation
s of theTestMethod
.- Returns:
- all test related
Annotation
s of theTestMethod
-