Interface ContractVerificationSource
- All Known Implementing Classes:
OpenApiRequestValidatorScanner,RestDocsScanner,SpringCloudContractScanner
An endpoint is considered verified as soon as any one source reports evidence for it, not all of them - teams may adopt Spring RestDocs, the Atlassian OpenAPI request validator, and Spring Cloud Contract incrementally, in any combination, so the sources are never required to agree.
Each implementation owns its own recursive directory walk and file-type filtering, since the three built-in sources scan different file types under different root directories.
-
Method Summary
Modifier and TypeMethodDescriptionList<com.arc_e_tect.gradle.detector.core.model.Endpoint> ScansrootDirrecursively and returns every endpoint this source found verification evidence for.default List<VerifiedContractTest> scanWithStatusCodes(File rootDir) ScansrootDirrecursively, same asscan(File), but additionally reports the HTTP status code each piece of evidence was detected to assert, when a source is able to determine one.
-
Method Details
-
scan
ScansrootDirrecursively and returns every endpoint this source found verification evidence for.The returned
Endpoint.declaringClass()andEndpoint.methodSignature()identify the test (or contract file) that supplied the evidence, not a production@RestController.- Parameters:
rootDir- the directory to scan recursively; scanning a non-existent or non-directory path returns an empty list rather than failing- Returns:
- possibly-empty list of verified endpoints, never
null - Throws:
IOException- if a file underrootDircannot be read
-
scanWithStatusCodes
ScansrootDirrecursively, same asscan(File), but additionally reports the HTTP status code each piece of evidence was detected to assert, when a source is able to determine one.The default implementation delegates to
scan(File)and reports every entry with no status code, so an implementation that has no meaningful way to detect one simply inherits correct, backward-compatible behavior without overriding anything.- Parameters:
rootDir- the directory to scan recursively; scanning a non-existent or non-directory path returns an empty list rather than failing- Returns:
- possibly-empty list of verified contract tests, never
null - Throws:
IOException- if a file underrootDircannot be read
-