Record Class ResponseCoverageRecord

java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.doppelganger.progress.ResponseCoverageRecord
Record Components:
fingerprint - the stable identifier for this endpoint + response code pair
verb - the endpoint's current HTTP verb; not part of the key, refreshed on every run that observes this endpoint
path - the endpoint's current path template; not part of the key, refreshed on every run that observes this endpoint
responseCode - the response code this record tracks, e.g. "200", "404"
testCount - the number of contract tests detected to cover this response code as of the most recent run that observed it
firstDeclaredAt - when this response code was first observed declared in the OpenAPI documentation, or null if it never has been
firstCoveredAt - when this response code was first observed covered by at least one contract test (testCount > 0), or null if it never has been
lastSeenAt - when this response code was last present in a run that could see it, or null for a record that has never actually been seen
removedAt - when this response code was first observed missing from the endpoint's declared response codes, or null while it's still declared

public record ResponseCoverageRecord(String fingerprint, com.arc_e_tect.gradle.detector.core.model.HttpVerb verb, String path, String responseCode, int testCount, Instant firstDeclaredAt, Instant firstCoveredAt, Instant lastSeenAt, Instant removedAt) extends Record
Persisted, per-endpoint-and-response-code history of contract test coverage, keyed by <endpoint fingerprint>-<response code> (see ResponseCoverageHistoryUpdater).

Deliberately separate from api-detector-core's cross-plugin ContractProgressRecord: response coverage is a Doppelganger-only concern with a different shape - testCount() is a live gauge refreshed every run, not a milestone timestamp stamped once.

  • Constructor Details

    • ResponseCoverageRecord

      public ResponseCoverageRecord(String fingerprint, com.arc_e_tect.gradle.detector.core.model.HttpVerb verb, String path, String responseCode, int testCount, Instant firstDeclaredAt, Instant firstCoveredAt, Instant lastSeenAt, Instant removedAt)
      Creates an instance of a ResponseCoverageRecord record class.
      Parameters:
      fingerprint - the value for the fingerprint record component
      verb - the value for the verb record component
      path - the value for the path record component
      responseCode - the value for the responseCode record component
      testCount - the value for the testCount record component
      firstDeclaredAt - the value for the firstDeclaredAt record component
      firstCoveredAt - the value for the firstCoveredAt record component
      lastSeenAt - the value for the lastSeenAt record component
      removedAt - the value for the removedAt record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • fingerprint

      public String fingerprint()
      Returns the value of the fingerprint record component.
      Returns:
      the value of the fingerprint record component
    • verb

      public com.arc_e_tect.gradle.detector.core.model.HttpVerb verb()
      Returns the value of the verb record component.
      Returns:
      the value of the verb record component
    • path

      public String path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • responseCode

      public String responseCode()
      Returns the value of the responseCode record component.
      Returns:
      the value of the responseCode record component
    • testCount

      public int testCount()
      Returns the value of the testCount record component.
      Returns:
      the value of the testCount record component
    • firstDeclaredAt

      public Instant firstDeclaredAt()
      Returns the value of the firstDeclaredAt record component.
      Returns:
      the value of the firstDeclaredAt record component
    • firstCoveredAt

      public Instant firstCoveredAt()
      Returns the value of the firstCoveredAt record component.
      Returns:
      the value of the firstCoveredAt record component
    • lastSeenAt

      public Instant lastSeenAt()
      Returns the value of the lastSeenAt record component.
      Returns:
      the value of the lastSeenAt record component
    • removedAt

      public Instant removedAt()
      Returns the value of the removedAt record component.
      Returns:
      the value of the removedAt record component