Class DuplicateScenarioTitles
java.lang.Object
com.arc_e_tect.gradle.gherkin.parser.DuplicateScenarioTitles
Finds scenarios whose title collides under
ScenarioFingerprint - the identity used to key
persisted progress history - regardless of whether the colliding scenarios were parsed from the
same .feature file or different ones.
ScenarioFingerprint deliberately hashes a scenario's title alone, so that a scenario
keeps its history when moved between feature files. That same title-only identity means two
distinct scenarios that merely happen to share a title are indistinguishable to it: within a
single run, whichever is processed last silently overwrites the other's entry in the persisted
history map, and across runs a stage timestamp genuinely earned by one can permanently leak onto
the other, since history timestamps are never cleared once set. Rejecting the collision outright,
before either the report or the history file is written, is simpler and safer than trying to
disambiguate the two scenarios after the fact.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA scenario title shared by two or moreDuplicateScenarioTitles.ScenarioOccurrences.static final recordA single scenario as parsed from a particular feature file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfind(List<DuplicateScenarioTitles.ScenarioOccurrence> occurrences) Finds every group of two or moreoccurrenceswhose scenario title collides underScenarioFingerprint.
-
Constructor Details
-
DuplicateScenarioTitles
public DuplicateScenarioTitles()Creates a newDuplicateScenarioTitles.
-
-
Method Details
-
find
public List<DuplicateScenarioTitles.Duplicate> find(List<DuplicateScenarioTitles.ScenarioOccurrence> occurrences) Finds every group of two or moreoccurrenceswhose scenario title collides underScenarioFingerprint.- Parameters:
occurrences- every scenario parsed this run, paired with the feature file it came from- Returns:
- one
DuplicateScenarioTitles.Duplicateper colliding title, in the order each title was first encountered; empty when no titles collide
-