Class ResponseCoverageHistoryStore
java.lang.Object
com.arc_e_tect.gradle.doppelganger.progress.ResponseCoverageHistoryStore
Reads and writes
ResponseCoverageRecords as newline-delimited JSON (NDJSON), one record
per line, sorted by ResponseCoverageRecord.fingerprint() so that git diffs of the
persisted file are minimal and stable - the same hand-rolled, dependency-free approach
api-detector-core's ContractHistoryStore uses for the cross-plugin contract
progress history.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLoads the response coverage history fromfile.voidsave(File file, Collection<ResponseCoverageRecord> records) Writesrecordstofileas NDJSON, sorted byResponseCoverageRecord.fingerprint(), overwriting any existing content.
-
Constructor Details
-
ResponseCoverageHistoryStore
public ResponseCoverageHistoryStore()Creates a newResponseCoverageHistoryStore.
-
-
Method Details
-
load
Loads the response coverage history fromfile.- Parameters:
file- the NDJSON history file; need not exist- Returns:
- the records keyed by fingerprint; empty when
filedoesn't exist. A line that fails to parse is skipped with aWARN-level log message identifying the line number - it never fails the build.
-
save
Writesrecordstofileas NDJSON, sorted byResponseCoverageRecord.fingerprint(), overwriting any existing content.- Parameters:
file- the NDJSON history file to writerecords- the records to persist
-