Record Class EndpointResponseCoverage

java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.doppelganger.detect.EndpointResponseCoverage
Record Components:
endpoint - the declared-and-implemented endpoint this row describes, carrying its declared response codes via DescribedEndpoint.responseCodes()
contractTestCount - the number of distinct contract tests found for this endpoint, across every enabled verification source, regardless of whether their asserted status code could be determined
untrackedTestCount - the number of those tests whose asserted status code either could not be determined, or was determined but is not among this endpoint's declared response codes - counted in contractTestCount() but not in testCountByResponseCode(); always 0 when response coverage was not requested
testCountByResponseCode - for every response code DescribedEndpoint.responseCodes() declares, the number of tests detected to assert it - including an entry with value 0 for a declared code no test covers; empty when response coverage was not requested

public record EndpointResponseCoverage(com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint endpoint, int contractTestCount, int untrackedTestCount, Map<String,Integer> testCountByResponseCode) extends Record
The scanContracts result for a single endpoint: how many response codes its OpenAPI operation declares, how many contract tests exist for it in total, and - only when includeResponseCoverage is enabled - how many of those tests cover each declared response code.
  • Constructor Details

    • EndpointResponseCoverage

      public EndpointResponseCoverage(com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint endpoint, int contractTestCount, int untrackedTestCount, Map<String,Integer> testCountByResponseCode)
      Creates an instance of a EndpointResponseCoverage record class.
      Parameters:
      endpoint - the value for the endpoint record component
      contractTestCount - the value for the contractTestCount record component
      untrackedTestCount - the value for the untrackedTestCount record component
      testCountByResponseCode - the value for the testCountByResponseCode record component
  • Method Details

    • declaredResponseCodes

      public List<String> declaredResponseCodes()
      The declared response codes for this endpoint - a convenience view of DescribedEndpoint.responseCodes().
      Returns:
      the declared response codes, sorted, possibly empty
    • 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.
    • endpoint

      public com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint endpoint()
      Returns the value of the endpoint record component.
      Returns:
      the value of the endpoint record component
    • contractTestCount

      public int contractTestCount()
      Returns the value of the contractTestCount record component.
      Returns:
      the value of the contractTestCount record component
    • untrackedTestCount

      public int untrackedTestCount()
      Returns the value of the untrackedTestCount record component.
      Returns:
      the value of the untrackedTestCount record component
    • testCountByResponseCode

      public Map<String,Integer> testCountByResponseCode()
      Returns the value of the testCountByResponseCode record component.
      Returns:
      the value of the testCountByResponseCode record component