Class TestOutcomeRequirementsTagProvider
java.lang.Object
net.thucydides.model.requirements.TestOutcomeRequirementsTagProvider
- All Implemented Interfaces:
CoreTagProvider,OverridableTagProvider,RequirementsTagProvider,RequirementTypesProvider,TagProvider
public class TestOutcomeRequirementsTagProvider
extends Object
implements RequirementsTagProvider, OverridableTagProvider, RequirementTypesProvider
Read requirements from test outcomes, based on the path specified in each test outcome
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.TestOutcomeRequirementsTagProvider(EnvironmentVariables environmentVariables) Constructor with EnvironmentVariables parameter. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequirementTagsTo(TestOutcome outcome) Adds requirement tags to the given TestOutcome.fromSourceDirectory(Path sourceDirectory) Get active requirement types based on the depth of each requirement.getParentRequirementOf(TestOutcome testOutcome) Fetches the parent requirement of a given TestOutcome.getParentRequirementOf(Requirement requirement) getRequirementFor(TestTag testTag) Get the requirements from the RequirementCache or load them if not present in the cache.getTagsFor(TestOutcome testOutcome) Returns the tags associated with a given test outcome.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.thucydides.model.requirements.RequirementsTagProvider
getOverview
-
Field Details
-
JUNIT5_FORMAT
- See Also:
-
JUNIT4_FORMAT
- See Also:
-
JAVASCRIPT_FORMAT
- See Also:
-
DEFAULT_TARGET_DIR
- See Also:
-
-
Constructor Details
-
TestOutcomeRequirementsTagProvider
public TestOutcomeRequirementsTagProvider()Default constructor. Initializes an instance of the TestOutcomeRequirementsTagProvider class with default environment variables. -
TestOutcomeRequirementsTagProvider
Constructor with EnvironmentVariables parameter. Initializes an instance of the TestOutcomeRequirementsTagProvider class with the provided environment variables.- Parameters:
environmentVariables- The EnvironmentVariables to be used for the TestOutcomeRequirementsTagProvider.
-
-
Method Details
-
fromSourceDirectory
-
getActiveRequirementTypes
Get active requirement types based on the depth of each requirement. The requirement types are listed in order of depth.- Specified by:
getActiveRequirementTypesin interfaceRequirementTypesProvider- Returns:
- List of active requirement types sorted by depth.
-
getRequirements
Get the requirements from the RequirementCache or load them if not present in the cache.- Specified by:
getRequirementsin interfaceRequirementsTagProvider- Returns:
- List of Requirement objects.
-
addRequirementTagsTo
Adds requirement tags to the given TestOutcome. The method gets the parent requirement from the RequirementCache and adds tags from the requirement hierarchy to the TestOutcome.- Specified by:
addRequirementTagsToin interfaceRequirementsTagProvider- Parameters:
outcome- The TestOutcome to which the requirement tags are to be added.
-
getParentRequirementOf
Fetches the parent requirement of a given TestOutcome. If the TestOutcome has no user story or path, returns an empty Optional. If no requirement matches the user story in the flattened requirements, an aliased requirement is fetched.- Specified by:
getParentRequirementOfin interfaceRequirementsTagProvider- Parameters:
testOutcome- The TestOutcome whose parent requirement is to be fetched.- Returns:
- Optional containing the parent requirement if it exists, else an empty Optional.
-
getParentRequirementOf
- Specified by:
getParentRequirementOfin interfaceRequirementsTagProvider
-
getRequirementFor
- Specified by:
getRequirementForin interfaceRequirementsTagProvider
-
getTagsFor
Description copied from interface:TagProviderReturns the tags associated with a given test outcome.- Specified by:
getTagsForin interfaceTagProvider- Parameters:
testOutcome- the outcome for a specific test- Returns:
- the tags associated with a given test outcome.
-
getFlattenedRequirements
-