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 theStubGenerator
.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description DslToWireMockConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canReadStubMapping(File mapping)
String
generateOutputFileNameForInput(String inputFileName)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.cloud.contract.verifier.converter.StubGenerator
convertContents, defaultStubMappingPostProcessing, fileExtension, postProcessStubMapping
-
-
-
-
Method Detail
-
generateOutputFileNameForInput
public String generateOutputFileNameForInput(String inputFileName)
- Specified by:
generateOutputFileNameForInput
in interfaceStubGenerator<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 isfoo.groovy
, it will be converted by the implementation tofoo.json
. The recursive file converter will create two files0_foo.json
and1_foo.json
-
canReadStubMapping
public boolean canReadStubMapping(File mapping)
- Specified by:
canReadStubMapping
in interfaceStubGenerator<com.github.tomakehurst.wiremock.stubbing.StubMapping>
- Parameters:
mapping
- - potential stub mapping mapping- Returns:
true
if this converter could have generated this mapping stub.
-
-