Interface ContractVerificationSource
- All Known Implementing Classes:
OpenApiRequestValidatorScanner,RestDocsScanner,SpringCloudContractScanner
public interface ContractVerificationSource
A pluggable source of "this endpoint's contract is verified" evidence.
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
-
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
-