Class ProgressHistoryUpdater

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

public class ProgressHistoryUpdater extends Object
Produces the next ScenarioProgressRecord map to persist, from the previously persisted map and the current run's scenarios.

Every current-run scenario keeps (or starts) a record keyed by ScenarioFingerprint.fingerprint(String): whichever of listedAt/definedAt/ implementedAt matches the scenario's current status is stamped with now the first time that status is observed, and is never overwritten afterwards - so a scenario that jumps straight from listed to implemented never gains a definedAt. Every previously persisted record whose fingerprint is no longer present in the current run is kept, unchanged, with removedAt stamped the first time it goes missing. Records are never deleted.

  • Constructor Details

    • ProgressHistoryUpdater

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

    • update

      public Map<String,ScenarioProgressRecord> update(Map<String,ScenarioProgressRecord> previous, List<ScenarioInfo> scenarios, List<io.cucumber.cucumberexpressions.Expression> glueCode, Instant now)
      Computes the updated history map to persist.
      Parameters:
      previous - the previously persisted history, keyed by fingerprint; empty on a first run
      scenarios - the current run's scenarios
      glueCode - the current run's step definition patterns, used to classify each scenario
      now - the instant to stamp newly-reached stages and newly-observed removals with
      Returns:
      the updated history map, keyed by fingerprint