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 recordTestMethodimplementation for JUnit/JUnit5.static final recordTestMethodimplementation for Spock.static final recordTestMethodimplementation for TestNG. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<TestMethod> Tries to create aTestMethodfrom the givenMethod.method()Returns theMethodof the test case.Returns all test relatedAnnotations of theTestMethod.Returns the name of the test case.Class<?> Returns theClassof theTestMethod.
-
Method Details
-
create
Tries to create aTestMethodfrom the givenMethod.- Parameters:
method- the potential testMethod- Returns:
- an
Optionalcontaining theTestMethodif theMethodis a test case.
-
method
Method method()Returns theMethodof the test case.- Returns:
- the
Methodof the test case
-
testCaseName
String testCaseName()Returns the name of the test case.- Returns:
- the name of test case
-
testClass
Class<?> testClass()Returns theClassof theTestMethod.- Returns:
- the
Classof theTestMethod
-
testAnnotations
List<Annotation> testAnnotations()Returns all test relatedAnnotations of theTestMethod.- Returns:
- all test related
Annotations of theTestMethod
-