Class DslToWireMockConverter

java.lang.Object
org.springframework.cloud.contract.verifier.wiremock.DslToWireMockConverter
All Implemented Interfaces:
StubGenerator<com.github.tomakehurst.wiremock.stubbing.StubMapping>
Direct Known Subclasses:
DslToWireMockClientConverter

public abstract class DslToWireMockConverter extends Object implements StubGenerator<com.github.tomakehurst.wiremock.stubbing.StubMapping>
WireMock implementation of the StubGenerator.
Since:
1.0.0
  • Constructor Details

    • DslToWireMockConverter

      public DslToWireMockConverter()
  • Method Details

    • generateOutputFileNameForInput

      public String generateOutputFileNameForInput(String inputFileName)
      Specified by:
      generateOutputFileNameForInput in interface StubGenerator<com.github.tomakehurst.wiremock.stubbing.StubMapping>
      Parameters:
      inputFileName - - name of the input file
      Returns:
      the name of the converted stub file. If you have multiple contracts in a single file then a prefix will be added to the generated file. If you provide the Contract.getName() field then that field will override the generated file name. Example: name of file with 2 contracts is foo.groovy, it will be converted by the implementation to foo.json. The recursive file converter will create two files 0_foo.json and 1_foo.json
    • canReadStubMapping

      public boolean canReadStubMapping(File mapping)
      Specified by:
      canReadStubMapping in interface StubGenerator<com.github.tomakehurst.wiremock.stubbing.StubMapping>
      Parameters:
      mapping - - potential stub mapping mapping
      Returns:
      true if this converter could have generated this mapping stub.