Package com.epages.restdocs
Class ResponseFieldTemplateDescriptor
- java.lang.Object
-
- com.epages.restdocs.ResponseFieldTemplateDescriptor
-
public class ResponseFieldTemplateDescriptor extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ResponseFieldTemplateDescriptor(java.lang.String path)Create a descriptor defining the replacement of a response field with a response template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetPath()java.lang.StringgetUriTemplateVariableName()java.lang.StringgetWireMockTemplateExpression()ResponseFieldTemplateDescriptorreplacedWithUriTemplateVariableValue(java.lang.String uriTemplateVariableName)The name of the URI template variable to use as a replacement.ResponseFieldTemplateDescriptorreplacedWithWireMockTemplateExpression(java.lang.String expression)Use a WireMock response template expression to replace the value atpath.
-
-
-
Constructor Detail
-
ResponseFieldTemplateDescriptor
public ResponseFieldTemplateDescriptor(java.lang.String path)
Create a descriptor defining the replacement of a response field with a response template. See http://wiremock.org/docs/response-templating/ for details.- Parameters:
path- jsonPath expression of the field to be replaced
-
-
Method Detail
-
getPath
public java.lang.String getPath()
-
getWireMockTemplateExpression
public java.lang.String getWireMockTemplateExpression()
-
getUriTemplateVariableName
public java.lang.String getUriTemplateVariableName()
-
replacedWithWireMockTemplateExpression
public ResponseFieldTemplateDescriptor replacedWithWireMockTemplateExpression(java.lang.String expression)
Use a WireMock response template expression to replace the value atpath. Expressions can be used as described in the WireMock Response Templating documentation Note thatreplacedWithUriTemplateVariableValueandreplacedWithWireMockTemplateExpressioncannot be used together.- Parameters:
expression- the Wiremock response template expression (state without curly braces - e.grequest.requestLine.pathSegments.[1])
-
replacedWithUriTemplateVariableValue
public ResponseFieldTemplateDescriptor replacedWithUriTemplateVariableValue(java.lang.String uriTemplateVariableName)
The name of the URI template variable to use as a replacement. This requires the use of URI templates using the methods inorg.springframework.restdocs.mockmvc.RestDocumentationRequestBuildersthat take aurlTemplateparameter. Note thatreplacedWithUriTemplateVariableValueandreplacedWithWireMockTemplateExpressioncannot be used together.- Parameters:
uriTemplateVariableName- the name of the variable in the URI template of the request
-
-