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

    Modifier and Type
    Method
    Description
    List<com.arc_e_tect.gradle.detector.core.model.Endpoint>
    scan(File rootDir)
    Scans rootDir recursively and returns every endpoint this source found verification evidence for.
  • Method Details

    • scan

      List<com.arc_e_tect.gradle.detector.core.model.Endpoint> scan(File rootDir) throws IOException
      Scans rootDir recursively and returns every endpoint this source found verification evidence for.

      The returned Endpoint.declaringClass() and Endpoint.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 under rootDir cannot be read