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 viaDescribedEndpoint.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 determineduntrackedTestCount- 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 incontractTestCount()but not intestCountByResponseCode(); always0when response coverage was not requestedtestCountByResponseCode- for every response codeDescribedEndpoint.responseCodes()declares, the number of tests detected to assert it - including an entry with value0for 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 Summary
ConstructorsConstructorDescriptionEndpointResponseCoverage(com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint endpoint, int contractTestCount, int untrackedTestCount, Map<String, Integer> testCountByResponseCode) Creates an instance of aEndpointResponseCoveragerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecontractTestCountrecord component.The declared response codes for this endpoint - a convenience view ofDescribedEndpoint.responseCodes().com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpointendpoint()Returns the value of theendpointrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thetestCountByResponseCoderecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of theuntrackedTestCountrecord component.
-
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 aEndpointResponseCoveragerecord class.- Parameters:
endpoint- the value for theendpointrecord componentcontractTestCount- the value for thecontractTestCountrecord componentuntrackedTestCount- the value for theuntrackedTestCountrecord componenttestCountByResponseCode- the value for thetestCountByResponseCoderecord component
-
-
Method Details
-
declaredResponseCodes
The declared response codes for this endpoint - a convenience view ofDescribedEndpoint.responseCodes().- Returns:
- the declared response codes, sorted, possibly empty
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
endpoint
public com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint endpoint()Returns the value of theendpointrecord component.- Returns:
- the value of the
endpointrecord component
-
contractTestCount
public int contractTestCount()Returns the value of thecontractTestCountrecord component.- Returns:
- the value of the
contractTestCountrecord component
-
untrackedTestCount
public int untrackedTestCount()Returns the value of theuntrackedTestCountrecord component.- Returns:
- the value of the
untrackedTestCountrecord component
-
testCountByResponseCode
Returns the value of thetestCountByResponseCoderecord component.- Returns:
- the value of the
testCountByResponseCoderecord component
-