Package org.approvej.approve
Class StackTraceTestFinderUtil
java.lang.Object
org.approvej.approve.StackTraceTestFinderUtil
Utility class to find the current test method using the stack trace.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TestMethodFinds the current test method using the stack trace.static PathfindTestSourcePath(Method testMethod) Finds the source path of the test method, making the following assumptions: the test class' name is also the name of the source file, the base package is at most 10 levels deep, the filename extension of the file isjava,kt,groovy, orscala
-
Method Details
-
currentTestMethod
Finds the current test method using the stack trace.- Returns:
- the currently executing test
Method
-
findTestSourcePath
Finds the source path of the test method, making the following assumptions:- the test class' name is also the name of the source file,
- the base package is at most 10 levels deep,
- the filename extension of the file is
java,kt,groovy, orscala
-