Package org.mockserver.model
Class HttpTemplate
java.lang.Object
- Author:
- jamesdbloom
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.mockserver.model.Action
Action.Direction, Action.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanResolves the template content used by the template engines: the inline template when set, otherwise the contents ofgetTemplateFile()read from the classpath or filesystem.getType()inthashCode()static HttpTemplateStatic builder to create an template for responding or forwarding requests.static HttpTemplatetemplate(HttpTemplate.TemplateType type, String template) Static builder to create an template for responding or forwarding requests.voidwithActionType(Action.Type actionType) withResponseModifier(HttpResponseModifier responseModifier) withResponseOverride(HttpResponse responseOverride) withTemplate(String template) withTemplateFile(String templateFile) Load the template from a file (resolved from the classpath or the filesystem) instead of providing it inline.Methods inherited from class org.mockserver.model.Action
getDelay, getExpectationId, isPrimary, setExpectationId, withDelay, withDelay, withPrimaryMethods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
HttpTemplate
-
-
Method Details
-
template
Static builder to create an template for responding or forwarding requests. -
template
Static builder to create an template for responding or forwarding requests.- Parameters:
template- the template for the response or request
-
getTemplateType
-
withTemplate
-
getTemplate
-
withTemplateFile
Load the template from a file (resolved from the classpath or the filesystem) instead of providing it inline. The inline template, when present, always takes precedence over the file.- Parameters:
templateFile- path to the file containing the template
-
getTemplateFile
-
getTemplateContent
Resolves the template content used by the template engines: the inline template when set, otherwise the contents ofgetTemplateFile()read from the classpath or filesystem. -
getResponseOverride
-
withResponseOverride
-
getResponseModifier
-
withResponseModifier
-
withActionType
-
getType
- Specified by:
getTypein classAction<HttpTemplate>
-
equals
- Overrides:
equalsin classAction<HttpTemplate>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAction<HttpTemplate>
-