Class JUnitInferrer
- java.lang.Object
-
- io.testproject.sdk.internal.reporting.inferrers.JUnitInferrer
-
- All Implemented Interfaces:
ReportSettingsInferrer
public class JUnitInferrer extends java.lang.Object implements ReportSettingsInferrer
JUnit inferrer for Project and Job names.
-
-
Constructor Summary
Constructors Constructor Description JUnitInferrer(java.util.List<java.lang.StackTraceElement> traces)
Initializes a new inferrer for JUnit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReportSettings
inferReportSettings()
Infers Project and Job names from JUnit annotations.java.lang.String
inferTestName()
Infers Test name using Junit annotations.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.testproject.sdk.internal.reporting.inferrers.ReportSettingsInferrer
getUnnamedEntries
-
-
-
-
Method Detail
-
inferReportSettings
public ReportSettings inferReportSettings()
Infers Project and Job names from JUnit annotations.SDK analyzes the call stack, searching for a method annotated with JUnit annotation. Name of package for the class containing the method is used for Project name. Name of class or the @DisplayName annotation (JUnit 5 only) is used for the Job name.
- Specified by:
inferReportSettings
in interfaceReportSettingsInferrer
- Returns:
- An instance of
ReportSettings
containing Project and Job names.
-
inferTestName
public java.lang.String inferTestName()
Infers Test name using Junit annotations.- Specified by:
inferTestName
in interfaceReportSettingsInferrer
- Returns:
- A name of the Test.
-
-