Class ResponseCoverageHistoryUpdater

java.lang.Object
com.arc_e_tect.gradle.doppelganger.progress.ResponseCoverageHistoryUpdater

public class ResponseCoverageHistoryUpdater extends Object
Produces the next ResponseCoverageRecord map to persist, from the previously persisted map and this run's EndpointResponseCoverage rows - the response-coverage counterpart of api-detector-core's ContractHistoryUpdater.

Unlike that shared updater, ResponseCoverageRecord.testCount() is a live gauge: refreshed on every run that observes the (endpoint, response code) pair, not a milestone stamped once. ResponseCoverageRecord.firstDeclaredAt() and ResponseCoverageRecord.firstCoveredAt() - the latter set the first time testCount > 0 - are the only fields with that once-only semantics. Every previously persisted record whose fingerprint is not seen this run keeps its last known values with removedAt stamped the first time it goes missing; a record that reappears has removedAt reset to null. Records are never deleted.

  • Constructor Details

    • ResponseCoverageHistoryUpdater

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

    • update

      Computes the updated history map to persist.
      Parameters:
      existing - the previously persisted history, keyed by fingerprint; empty on a first run
      currentRun - this run's response coverage rows, computed with includeResponseCoverage enabled
      now - the instant to stamp newly-reached milestones and newly-observed removals with
      Returns:
      the updated history map, keyed by fingerprint