Record Class OpenApiCoverageReporter.CoverageReport
java.lang.Object
java.lang.Record
com.shaft.capture.generate.api.internal.OpenApiCoverageReporter.CoverageReport
- Record Components:
loadable- whether the spec could be read and parsedloadFailureReason- safe reasonloadableisfalse; empty otherwisecoveredOperations-METHOD normalized-pathoperations recorded AND declared, sortedmissingOperations-METHOD normalized-pathoperations declared but never recorded, sortedundeclaredOperations-METHOD normalized-pathoperations recorded but not declared by the spec, sortedtotalDeclaredOperations- total number of operations declared by the speccoverageRatio-coveredOperations.size() / totalDeclaredOperations,0.0when the spec declares no operations
- Enclosing class:
OpenApiCoverageReporter
public static record OpenApiCoverageReporter.CoverageReport(boolean loadable, String loadFailureReason, List<String> coveredOperations, List<String> missingOperations, List<String> undeclaredOperations, int totalDeclaredOperations, double coverageRatio)
extends Record
Deterministic coverage report diffing recorded transactions against a declared OpenAPI spec.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thecoverageRatiorecord component.Returns the value of thecoveredOperationsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanloadable()Returns the value of theloadablerecord component.Returns the value of theloadFailureReasonrecord component.Returns the value of themissingOperationsrecord component.notLoadable(String reason) Returns a not-loadable report carrying a safe failure reason.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalDeclaredOperationsrecord component.Returns the value of theundeclaredOperationsrecord component.
-
Constructor Details
-
CoverageReport
public CoverageReport(boolean loadable, String loadFailureReason, List<String> coveredOperations, List<String> missingOperations, List<String> undeclaredOperations, int totalDeclaredOperations, double coverageRatio) Creates an instance of aCoverageReportrecord class.- Parameters:
loadable- the value for theloadablerecord componentloadFailureReason- the value for theloadFailureReasonrecord componentcoveredOperations- the value for thecoveredOperationsrecord componentmissingOperations- the value for themissingOperationsrecord componentundeclaredOperations- the value for theundeclaredOperationsrecord componenttotalDeclaredOperations- the value for thetotalDeclaredOperationsrecord componentcoverageRatio- the value for thecoverageRatiorecord component
-
-
Method Details
-
notLoadable
Returns a not-loadable report carrying a safe failure reason.- Parameters:
reason- safe failure reason- Returns:
- not-loadable report
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
loadable
-
loadFailureReason
Returns the value of theloadFailureReasonrecord component.- Returns:
- the value of the
loadFailureReasonrecord component
-
coveredOperations
Returns the value of thecoveredOperationsrecord component.- Returns:
- the value of the
coveredOperationsrecord component
-
missingOperations
Returns the value of themissingOperationsrecord component.- Returns:
- the value of the
missingOperationsrecord component
-
undeclaredOperations
Returns the value of theundeclaredOperationsrecord component.- Returns:
- the value of the
undeclaredOperationsrecord component
-
totalDeclaredOperations
public int totalDeclaredOperations()Returns the value of thetotalDeclaredOperationsrecord component.- Returns:
- the value of the
totalDeclaredOperationsrecord component
-
coverageRatio
public double coverageRatio()Returns the value of thecoverageRatiorecord component.- Returns:
- the value of the
coverageRatiorecord component
-