Record Class FixtureResult

java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.trackerlens.fixture.FixtureResult
Record Components:
bddScenarios - the generated BDD-scenario records
apiContracts - 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 Details

  • Method Details

    • writeTo

      public void writeTo(File bddScenarioHistoryFile, File apiContractHistoryFile)
      Writes both trackers' records to bddScenarioHistoryFile and apiContractHistoryFile, each in the exact NDJSON format its real TrackerSource reads - gherkin-to-asciidoc's ProgressHistoryStore and api-detector-core's ContractHistoryStore shapes 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 write bddScenarios() to
      apiContractHistoryFile - the file to write apiContracts() to
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • bddScenarios

      public List<BddScenarioFixtureRecord> bddScenarios()
      Returns the value of the bddScenarios record component.
      Returns:
      the value of the bddScenarios record component
    • apiContracts

      public List<ApiContractFixtureRecord> apiContracts()
      Returns the value of the apiContracts record component.
      Returns:
      the value of the apiContracts record component