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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canReadStubMapping
(File mapping) 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
-
Constructor Details
-
DslToWireMockConverter
public DslToWireMockConverter()
-
-
Method Details
-
generateOutputFileNameForInput
- 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
- 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.
-