Record Class FixtureResult
java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.trackerlens.fixture.FixtureResult
- Record Components:
bddScenarios- the generated BDD-scenario recordsapiContracts- the generated API-contract records
public record FixtureResult(List<BddScenarioFixtureRecord> bddScenarios, List<ApiContractFixtureRecord> apiContracts)
extends Record
The in-memory result of
TrackerLensFixtureGenerator.generate(FixtureSpec): both
trackers' generated records, plus a way to write them to disk.
Generating in memory first and writing second - rather than only ever writing straight to
disk - is what lets an automated test consume bddScenarios() and
apiContracts() directly, with no filesystem round trip at all.
-
Constructor Summary
ConstructorsConstructorDescriptionFixtureResult(List<BddScenarioFixtureRecord> bddScenarios, List<ApiContractFixtureRecord> apiContracts) Defensively copies both lists into unmodifiable ones. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theapiContractsrecord component.Returns the value of thebddScenariosrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.voidWrites both trackers' records tobddScenarioHistoryFileandapiContractHistoryFile, each in the exact NDJSON format its realTrackerSourcereads -gherkin-to-asciidoc'sProgressHistoryStoreandapi-detector-core'sContractHistoryStoreshapes respectively, schema-version marker line included, sorted by fingerprint.
-
Constructor Details
-
FixtureResult
public FixtureResult(List<BddScenarioFixtureRecord> bddScenarios, List<ApiContractFixtureRecord> apiContracts) Defensively copies both lists into unmodifiable ones.
-
-
Method Details
-
writeTo
Writes both trackers' records tobddScenarioHistoryFileandapiContractHistoryFile, each in the exact NDJSON format its realTrackerSourcereads -gherkin-to-asciidoc'sProgressHistoryStoreandapi-detector-core'sContractHistoryStoreshapes respectively, schema-version marker line included, sorted by fingerprint. The written files are ordinary history files, indistinguishable from real usage data - there is no fixture marker in the format itself.- Parameters:
bddScenarioHistoryFile- the file to writebddScenarios()toapiContractHistoryFile- the file to writeapiContracts()to
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
bddScenarios
Returns the value of thebddScenariosrecord component.- Returns:
- the value of the
bddScenariosrecord component
-
apiContracts
Returns the value of theapiContractsrecord component.- Returns:
- the value of the
apiContractsrecord component
-