Class SpringCloudContractScanner

java.lang.Object
com.arc_e_tect.gradle.doppelganger.scan.SpringCloudContractScanner
All Implemented Interfaces:
ContractVerificationSource

public class SpringCloudContractScanner extends Object implements ContractVerificationSource
ContractVerificationSource for Spring Cloud Contract: declarative contract DSL files under src/testContract/resources/contracts/**/*.groovy (and .yml), read structurally for method '...' and url '...' / urlPath '...' entries.

Contract files are data, not code - this is a plain line/regex scan, deliberately without an AST or a Groovy/YAML parser on the classpath.

  • Constructor Details

    • SpringCloudContractScanner

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

    • scan

      public 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.

      Specified by:
      scan in interface ContractVerificationSource
      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