T
- - type of stub mappingpublic interface StubGenerator<T>
Modifier and Type | Method and Description |
---|---|
default boolean |
canReadStubMapping(File mapping) |
Map<org.springframework.cloud.contract.spec.Contract,String> |
convertContents(String rootName,
ContractMetadata content) |
default T |
defaultStubMappingPostProcessing(T stubMapping,
org.springframework.cloud.contract.spec.Contract contract)
Stub mapping to chose when no post processors where found on the classpath.
|
default String |
fileExtension()
Describes the file extension of the generated mapping that this stub generator can
handle.
|
String |
generateOutputFileNameForInput(String inputFileName) |
default T |
postProcessStubMapping(T stubMapping,
org.springframework.cloud.contract.spec.Contract contract)
Post process a generated stub mapping.
|
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, ContractMetadata content)
rootName
- - root name of the contractcontent
- - metadata of the contractdefault T postProcessStubMapping(T stubMapping, org.springframework.cloud.contract.spec.Contract contract)
stubMapping
- - mapping of a stubcontract
- - contract for which stub was generateddefault T defaultStubMappingPostProcessing(T stubMapping, org.springframework.cloud.contract.spec.Contract contract)
stubMapping
- - mapping of a stubcontract
- - contract for which stub was generatedString 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.