Class DoppelgangerApiReportWriter

java.lang.Object
com.arc_e_tect.gradle.doppelganger.report.DoppelgangerApiReportWriter

public class DoppelgangerApiReportWriter extends Object
Writes the AsciiDoc doppelganger API report: every endpoint that is declared in the OpenAPI documentation and implemented by a @RestController method, but has no verification evidence from any enabled ContractVerificationSource.

Every report opens with a preamble explaining what a doppelganger API is, loaded from the "doppelganger-api-preamble.adoc" classpath resource so that explanatory text can be revised without touching this class.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new DoppelgangerApiReportWriter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    write(File outputFile, int totalCandidateCount, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> doppelgangers, String systemUnderTestVersion)
    Writes the report to outputFile, creating its parent directory if necessary.
    void
    write(File outputFile, int totalCandidateCount, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> doppelgangers, String systemUnderTestVersion, List<String> warnings, Map<String,com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory)
    Writes the report to outputFile, creating its parent directory if necessary.
    void
    write(File outputFile, int totalCandidateCount, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> doppelgangers, String systemUnderTestVersion, Map<String,com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory)
    Writes the report to outputFile, creating its parent directory if necessary.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DoppelgangerApiReportWriter

      public DoppelgangerApiReportWriter()
      Creates a new DoppelgangerApiReportWriter.
  • Method Details

    • write

      public void write(File outputFile, int totalCandidateCount, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> doppelgangers, String systemUnderTestVersion) throws IOException
      Writes the report to outputFile, creating its parent directory if necessary. Equivalent to write(File, int, List, String, List, Map) with no warnings and an empty contract history.
      Parameters:
      outputFile - target AsciiDoc file
      totalCandidateCount - total number of endpoints both declared and implemented, i.e. the candidate pool checked for verification evidence
      doppelgangers - the candidate endpoints with no verification evidence
      systemUnderTestVersion - version of the system under test that was scanned
      Throws:
      IOException - if the output file cannot be written
    • write

      public void write(File outputFile, int totalCandidateCount, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> doppelgangers, String systemUnderTestVersion, Map<String,com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory) throws IOException
      Writes the report to outputFile, creating its parent directory if necessary. Equivalent to write(File, int, List, String, List, Map) with no warnings.
      Parameters:
      outputFile - target AsciiDoc file
      totalCandidateCount - total number of endpoints both declared and implemented, i.e. the candidate pool checked for verification evidence
      doppelgangers - the candidate endpoints with no verification evidence
      systemUnderTestVersion - version of the system under test that was scanned
      contractHistory - contract progress history to render as a == Progress Over Time section, keyed by fingerprint; when empty, no such section is written
      Throws:
      IOException - if the output file cannot be written
    • write

      public void write(File outputFile, int totalCandidateCount, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> doppelgangers, String systemUnderTestVersion, List<String> warnings, Map<String,com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory) throws IOException
      Writes the report to outputFile, creating its parent directory if necessary.
      Parameters:
      outputFile - target AsciiDoc file
      totalCandidateCount - total number of endpoints both declared and implemented, i.e. the candidate pool checked for verification evidence
      doppelgangers - the candidate endpoints with no verification evidence
      systemUnderTestVersion - version of the system under test that was scanned
      warnings - non-fatal configuration gaps to render as a WARNING admonition right after the report header - e.g. a configured rootDocument, controllerDirs, testDirs, or contractsDir entry that doesn't exist yet; when empty, no such admonition is written
      contractHistory - contract progress history to render as a == Progress Over Time section, keyed by fingerprint; when empty, no such section is written
      Throws:
      IOException - if the output file cannot be written