public class HandlebarsTemplateProcessor extends Object implements TemplateProcessor, org.springframework.cloud.contract.spec.ContractTemplate
| Constructor and Description |
|---|
HandlebarsTemplateProcessor() |
public String transform(org.springframework.cloud.contract.spec.internal.Request request, String testContents)
TemplateProcessorRequest and the test contents should perform a transformation
and return the converted test.transform in interface TemplateProcessorpublic boolean containsTemplateEntry(String line)
containsTemplateEntry in interface TemplateProcessortrue if the current line contains template related entry. E.g. for
Handlebars if a line contains {{{...}}} then it's considered to contain template
related entrypublic boolean containsJsonPathTemplateEntry(String line)
containsJsonPathTemplateEntry in interface TemplateProcessortrue if the current line contains template related entry for json
path processing. E.g. for Handlebars if a line contains {{{jsonpath ...}}} or
{{{jsonPath ...}}} then it's considered to contain template related entry for json
path processingpublic String jsonPathFromTemplateEntry(String line)
jsonPathFromTemplateEntry in interface TemplateProcessor$.a.b.c. Returns empty string if there's no matching json path entrypublic boolean startsWithTemplate(String text)
startsWithTemplate in interface org.springframework.cloud.contract.spec.ContractTemplatepublic boolean startsWithEscapedTemplate(String text)
startsWithEscapedTemplate in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String openingTemplate()
openingTemplate in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String closingTemplate()
closingTemplate in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedOpeningTemplate()
escapedOpeningTemplate in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedClosingTemplate()
escapedClosingTemplate in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String url()
url in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String query(String key)
query in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String query(String key, int index)
query in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String path()
path in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String path(int index)
path in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String header(String key)
header in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String header(String key, int index)
header in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String cookie(String key)
cookie in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String body()
body in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String body(String jsonPath)
body in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedUrl()
escapedUrl in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedQuery(String key)
escapedQuery in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedQuery(String key, int index)
escapedQuery in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedPath()
escapedPath in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedPath(int index)
escapedPath in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedHeader(String key)
escapedHeader in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedHeader(String key, int index)
escapedHeader in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedCookie(String key)
escapedCookie in interface org.springframework.cloud.contract.spec.ContractTemplatepublic String escapedBody()
escapedBody in interface org.springframework.cloud.contract.spec.ContractTemplateCopyright © 2016–2020 Spring. All rights reserved.