public interface StubGenerator
Modifier and Type | Method and Description |
---|---|
default boolean |
canReadStubMapping(File mapping) |
default boolean |
canReadStubMapping(String fileName)
Deprecated.
|
Map<org.springframework.cloud.contract.spec.Contract,String> |
convertContents(String rootName,
org.springframework.cloud.contract.verifier.file.ContractMetadata content) |
default String |
fileExtension()
Describes the file extension of the generated mapping that this stub generator can
handle.
|
String |
generateOutputFileNameForInput(String inputFileName) |
@Deprecated default boolean canReadStubMapping(String fileName)
canReadStubMapping(File)
fileName
- - file nametrue
if the converter can handle the file to convert it into a
stub.default boolean canReadStubMapping(File mapping)
mapping
- - potential stub mapping mappingtrue
if this converter could have generated this mapping stub.Map<org.springframework.cloud.contract.spec.Contract,String> convertContents(String rootName, org.springframework.cloud.contract.verifier.file.ContractMetadata content)
rootName
- - root name of the contractcontent
- - metadata of the contractString generateOutputFileNameForInput(String inputFileName)
inputFileName
- - name of the input fileContract.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
default String fileExtension()
Copyright © 2016–2022 Spring. All rights reserved.