Class ResponseCoverageHistoryUpdater
java.lang.Object
com.arc_e_tect.gradle.doppelganger.progress.ResponseCoverageHistoryUpdater
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 Summary
ConstructorsConstructorDescriptionCreates a newResponseCoverageHistoryUpdater. -
Method Summary
Modifier and TypeMethodDescriptionupdate(Map<String, ResponseCoverageRecord> existing, List<EndpointResponseCoverage> currentRun, Instant now) Computes the updated history map to persist.
-
Constructor Details
-
ResponseCoverageHistoryUpdater
public ResponseCoverageHistoryUpdater()Creates a newResponseCoverageHistoryUpdater.
-
-
Method Details
-
update
public Map<String,ResponseCoverageRecord> update(Map<String, ResponseCoverageRecord> existing, List<EndpointResponseCoverage> currentRun, Instant now) Computes the updated history map to persist.- Parameters:
existing- the previously persisted history, keyed by fingerprint; empty on a first runcurrentRun- this run's response coverage rows, computed withincludeResponseCoverageenablednow- the instant to stamp newly-reached milestones and newly-observed removals with- Returns:
- the updated history map, keyed by fingerprint
-