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 parsed
loadFailureReason - safe reason loadable is false; empty otherwise
coveredOperations - METHOD normalized-path operations recorded AND declared, sorted
missingOperations - METHOD normalized-path operations declared but never recorded, sorted
undeclaredOperations - METHOD normalized-path operations recorded but not declared by the spec, sorted
totalDeclaredOperations - total number of operations declared by the spec
coverageRatio - coveredOperations.size() / totalDeclaredOperations, 0.0 when 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 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 a CoverageReport record class.
      Parameters:
      loadable - the value for the loadable record component
      loadFailureReason - the value for the loadFailureReason record component
      coveredOperations - the value for the coveredOperations record component
      missingOperations - the value for the missingOperations record component
      undeclaredOperations - the value for the undeclaredOperations record component
      totalDeclaredOperations - the value for the totalDeclaredOperations record component
      coverageRatio - the value for the coverageRatio record component
  • Method Details

    • notLoadable

      public static OpenApiCoverageReporter.CoverageReport notLoadable(String reason)
      Returns a not-loadable report carrying a safe failure reason.
      Parameters:
      reason - safe failure reason
      Returns:
      not-loadable report
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • loadable

      public boolean loadable()
      Returns the value of the loadable record component.
      Returns:
      the value of the loadable record component
    • loadFailureReason

      public String loadFailureReason()
      Returns the value of the loadFailureReason record component.
      Returns:
      the value of the loadFailureReason record component
    • coveredOperations

      public List<String> coveredOperations()
      Returns the value of the coveredOperations record component.
      Returns:
      the value of the coveredOperations record component
    • missingOperations

      public List<String> missingOperations()
      Returns the value of the missingOperations record component.
      Returns:
      the value of the missingOperations record component
    • undeclaredOperations

      public List<String> undeclaredOperations()
      Returns the value of the undeclaredOperations record component.
      Returns:
      the value of the undeclaredOperations record component
    • totalDeclaredOperations

      public int totalDeclaredOperations()
      Returns the value of the totalDeclaredOperations record component.
      Returns:
      the value of the totalDeclaredOperations record component
    • coverageRatio

      public double coverageRatio()
      Returns the value of the coverageRatio record component.
      Returns:
      the value of the coverageRatio record component