Class MirageApiReportWriter
@RestController implementation.
Every report opens with a preamble explaining what a mirage API is, loaded from the
"mirage-api-preamble.adoc" classpath resource so that explanatory text can be revised without
touching this class. When scanMocks was true for the run, a second preamble -
"mirage-api-stub-scanning-preamble.adoc" - explaining what the stub scan can and cannot match,
shadow stubs, and multiple stub files covering one endpoint, is written right after it, since
every Stubbed figure the rest of the report shows depends on understanding those
limits. Whenever contractHistory is non-empty - i.e. whenever the
== Progress Over Time section itself is written - a third preamble,
"mirage-api-removed-preamble.adoc", explains why an endpoint becomes removed (postponed,
obsolete, or replaced after an error in its original definition), right before that section.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(File outputFile, int totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, String systemUnderTestVersion) Writes the report tooutputFile, creating its parent directory if necessary.voidwrite(File outputFile, int totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, String systemUnderTestVersion, List<String> warnings, Map<String, com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory) Writes the report tooutputFile, creating its parent directory if necessary.voidwrite(File outputFile, int totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, String systemUnderTestVersion, Map<String, com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory) Writes the report tooutputFile, creating its parent directory if necessary.voidwrite(File outputFile, int totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, List<ExcludedMirage> excludedMirages, String systemUnderTestVersion, List<String> warnings, Map<String, com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory) Writes the report tooutputFile, creating its parent directory if necessary.voidwrite(File outputFile, int totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, List<ExcludedMirage> excludedMirages, String systemUnderTestVersion, List<String> warnings, Map<String, com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory, boolean scanMocks) Writes the report tooutputFile, creating its parent directory if necessary.
-
Constructor Details
-
MirageApiReportWriter
public MirageApiReportWriter()Creates a newMirageApiReportWriter.
-
-
Method Details
-
write
public void write(File outputFile, int totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, String systemUnderTestVersion) throws IOException Writes the report tooutputFile, creating its parent directory if necessary. Equivalent to callingwrite(File, int, List, String, List, Map)with no warnings and an empty contract history.- Parameters:
outputFile- target AsciiDoc filetotalDescribedCount- total number of endpoints described by the OpenAPI documentationmirages- the described endpoints not implemented by any controllersystemUnderTestVersion- 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 totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, String systemUnderTestVersion, Map<String, com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory) throws IOExceptionWrites the report tooutputFile, creating its parent directory if necessary. Equivalent to callingwrite(File, int, List, String, List, Map)with no warnings.- Parameters:
outputFile- target AsciiDoc filetotalDescribedCount- total number of endpoints described by the OpenAPI documentationmirages- the described endpoints with no matching@RestControllerimplementationsystemUnderTestVersion- version of the system under test that was scannedcontractHistory- contract progress history to render as a== Progress Over Timesection, 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 totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, String systemUnderTestVersion, List<String> warnings, Map<String, com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory) throws IOExceptionWrites the report tooutputFile, creating its parent directory if necessary. Equivalent to callingwrite(File, int, List, List, String, List, Map)with an empty excluded-mirages list.- Parameters:
outputFile- target AsciiDoc filetotalDescribedCount- total number of endpoints described by the OpenAPI documentationmirages- the described endpoints with no matching@RestControllerimplementationsystemUnderTestVersion- version of the system under test that was scannedwarnings- non-fatal configuration gaps to render as aWARNINGadmonition right after the report header - e.g. a configuredrootDocumentorcontrollerDirsentry that doesn't exist yet; when empty, no such admonition is writtencontractHistory- contract progress history to render as a== Progress Over Timesection, 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 totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, List<ExcludedMirage> excludedMirages, String systemUnderTestVersion, List<String> warnings, Map<String, com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory) throws IOExceptionWrites the report tooutputFile, creating its parent directory if necessary.- Parameters:
outputFile- target AsciiDoc filetotalDescribedCount- total number of endpoints described by the OpenAPI documentationmirages- the described endpoints with no matching@RestControllerimplementation, excluding any matched by a configured exclusion rule - these are the endpoints that can failfailOnMirageexcludedMirages- described-but-unimplemented endpoints matched by a configured exclusion rule, paired with their current-run WireMock stub status; rendered under== Excluded Mirage APIsinstead of== Mirage APIs, never fails the build, and never appears in contract history - when empty, no such section is writtensystemUnderTestVersion- version of the system under test that was scannedwarnings- non-fatal configuration gaps to render as aWARNINGadmonition right after the report header - e.g. a configuredrootDocumentorcontrollerDirsentry that doesn't exist yet; when empty, no such admonition is writtencontractHistory- contract progress history to render as a== Progress Over Timesection, 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 totalDescribedCount, List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> mirages, List<ExcludedMirage> excludedMirages, String systemUnderTestVersion, List<String> warnings, Map<String, com.arc_e_tect.gradle.detector.core.progress.ContractProgressRecord> contractHistory, boolean scanMocks) throws IOExceptionWrites the report tooutputFile, creating its parent directory if necessary.- Parameters:
outputFile- target AsciiDoc filetotalDescribedCount- total number of endpoints described by the OpenAPI documentationmirages- the described endpoints with no matching@RestControllerimplementation, excluding any matched by a configured exclusion rule - these are the endpoints that can failfailOnMirageexcludedMirages- described-but-unimplemented endpoints matched by a configured exclusion rule, paired with their current-run WireMock stub status; rendered under== Excluded Mirage APIsinstead of== Mirage APIs, never fails the build, and never appears in contract history - when empty, no such section is writtensystemUnderTestVersion- version of the system under test that was scannedwarnings- non-fatal configuration gaps to render as aWARNINGadmonition right after the report header - e.g. a configuredrootDocumentorcontrollerDirsentry that doesn't exist yet; when empty, no such admonition is writtencontractHistory- contract progress history to render as a== Progress Over Timesection, keyed by fingerprint; when empty, no such section is writtenscanMocks- whether stub mapping/Java DSL scanning was enabled for this run - whentrue, an additional preamble explaining what the stub scan can and cannot match, shadow stubs, and multiple stub files covering one endpoint is written right after the main preamble- Throws:
IOException- if the output file cannot be written
-