Class ScenarioFingerprint

java.lang.Object
com.arc_e_tect.gradle.gherkin.progress.ScenarioFingerprint

public class ScenarioFingerprint extends Object
Computes a stable identifier for a scenario from its name alone, deliberately ignoring which Feature file it currently lives in - so ProgressHistoryUpdater keeps recognising the same scenario even after it has been moved between feature files.

The scenario's Scenario:/Scenario Outline: keyword prefix and any existing index prefix (the \d+(?:\.\d+)? - format FeatureIndexer writes) are both stripped before hashing, so neither the scenario type nor its current numbering affects the fingerprint.

  • Constructor Details

    • ScenarioFingerprint

      public ScenarioFingerprint()
      Creates a new ScenarioFingerprint.
  • Method Details

    • fingerprint

      public String fingerprint(String scenarioTitle)
      Computes the fingerprint for a scenario's title.
      Parameters:
      scenarioTitle - the scenario's display title, e.g. "Scenario: 1.2 - User logs in"
      Returns:
      the first 16 hex characters of the SHA-256 hash of the normalized scenario name