Class ResponseDefinition
- java.lang.Object
-
- com.github.tomakehurst.wiremock.http.ResponseDefinition
-
public class ResponseDefinition extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ResponseDefinition()
ResponseDefinition(int statusCode, byte[] bodyContent)
ResponseDefinition(int statusCode, java.lang.String bodyContent)
ResponseDefinition(int status, java.lang.String statusMessage, byte[] body, com.fasterxml.jackson.databind.JsonNode jsonBody, java.lang.String base64Body, java.lang.String bodyFileName, HttpHeaders headers, HttpHeaders additionalProxyRequestHeaders, java.lang.Integer fixedDelayMilliseconds, DelayDistribution delayDistribution, ChunkedDribbleDelay chunkedDribbleDelay, java.lang.String proxyBaseUrl, java.lang.String proxyUrlPrefixToRemove, Fault fault, java.util.List<java.lang.String> transformers, Parameters transformerParameters, java.lang.Boolean wasConfigured)
ResponseDefinition(int status, java.lang.String statusMessage, Body body, java.lang.String bodyFileName, HttpHeaders headers, HttpHeaders additionalProxyRequestHeaders, java.lang.Integer fixedDelayMilliseconds, DelayDistribution delayDistribution, ChunkedDribbleDelay chunkedDribbleDelay, java.lang.String proxyBaseUrl, java.lang.String proxyUrlPrefixToRemove, Fault fault, java.util.List<java.lang.String> transformers, Parameters transformerParameters, java.lang.Boolean wasConfigured)
ResponseDefinition(int status, java.lang.String statusMessage, java.lang.String body, com.fasterxml.jackson.databind.JsonNode jsonBody, java.lang.String base64Body, java.lang.String bodyFileName, HttpHeaders headers, HttpHeaders additionalProxyRequestHeaders, java.lang.Integer fixedDelayMilliseconds, DelayDistribution delayDistribution, ChunkedDribbleDelay chunkedDribbleDelay, java.lang.String proxyBaseUrl, java.lang.String proxyUrlPrefixToRemove, Fault fault, java.util.List<java.lang.String> transformers, Parameters transformerParameters, java.lang.Boolean wasConfigured)
-
Method Summary
-
-
-
Constructor Detail
-
ResponseDefinition
public ResponseDefinition(int status, java.lang.String statusMessage, java.lang.String body, com.fasterxml.jackson.databind.JsonNode jsonBody, java.lang.String base64Body, java.lang.String bodyFileName, HttpHeaders headers, HttpHeaders additionalProxyRequestHeaders, java.lang.Integer fixedDelayMilliseconds, DelayDistribution delayDistribution, ChunkedDribbleDelay chunkedDribbleDelay, java.lang.String proxyBaseUrl, java.lang.String proxyUrlPrefixToRemove, Fault fault, java.util.List<java.lang.String> transformers, Parameters transformerParameters, java.lang.Boolean wasConfigured)
-
ResponseDefinition
public ResponseDefinition(int status, java.lang.String statusMessage, byte[] body, com.fasterxml.jackson.databind.JsonNode jsonBody, java.lang.String base64Body, java.lang.String bodyFileName, HttpHeaders headers, HttpHeaders additionalProxyRequestHeaders, java.lang.Integer fixedDelayMilliseconds, DelayDistribution delayDistribution, ChunkedDribbleDelay chunkedDribbleDelay, java.lang.String proxyBaseUrl, java.lang.String proxyUrlPrefixToRemove, Fault fault, java.util.List<java.lang.String> transformers, Parameters transformerParameters, java.lang.Boolean wasConfigured)
-
ResponseDefinition
public ResponseDefinition(int status, java.lang.String statusMessage, Body body, java.lang.String bodyFileName, HttpHeaders headers, HttpHeaders additionalProxyRequestHeaders, java.lang.Integer fixedDelayMilliseconds, DelayDistribution delayDistribution, ChunkedDribbleDelay chunkedDribbleDelay, java.lang.String proxyBaseUrl, java.lang.String proxyUrlPrefixToRemove, Fault fault, java.util.List<java.lang.String> transformers, Parameters transformerParameters, java.lang.Boolean wasConfigured)
-
ResponseDefinition
public ResponseDefinition(int statusCode, java.lang.String bodyContent)
-
ResponseDefinition
public ResponseDefinition(int statusCode, byte[] bodyContent)
-
ResponseDefinition
public ResponseDefinition()
-
-
Method Detail
-
notFound
public static ResponseDefinition notFound()
-
ok
public static ResponseDefinition ok()
-
okEmptyJson
public static ResponseDefinition okEmptyJson()
-
okForJson
public static <T> ResponseDefinition okForJson(T body)
-
created
public static ResponseDefinition created()
-
noContent
public static ResponseDefinition noContent()
-
badRequest
public static ResponseDefinition badRequest(Errors errors)
-
badRequestEntity
public static ResponseDefinition badRequestEntity(Errors errors)
-
redirectTo
public static ResponseDefinition redirectTo(java.lang.String path)
-
notConfigured
public static ResponseDefinition notConfigured()
-
notAuthorised
public static ResponseDefinition notAuthorised()
-
notPermitted
public static ResponseDefinition notPermitted(java.lang.String message)
-
notPermitted
public static ResponseDefinition notPermitted(Errors errors)
-
browserProxy
public static ResponseDefinition browserProxy(Request originalRequest)
-
copyOf
public static ResponseDefinition copyOf(ResponseDefinition original)
-
copy
public ResponseDefinition copy()
-
getHeaders
public HttpHeaders getHeaders()
-
getAdditionalProxyRequestHeaders
public HttpHeaders getAdditionalProxyRequestHeaders()
-
getStatus
public int getStatus()
-
getStatusMessage
public java.lang.String getStatusMessage()
-
getBody
public java.lang.String getBody()
-
getTextBody
public java.lang.String getTextBody()
-
getByteBody
public byte[] getByteBody()
-
getByteBodyIfBinary
public byte[] getByteBodyIfBinary()
-
getBase64Body
public java.lang.String getBase64Body()
-
getReponseBody
public Body getReponseBody()
-
getJsonBody
public com.fasterxml.jackson.databind.JsonNode getJsonBody()
-
getBodyFileName
public java.lang.String getBodyFileName()
-
wasConfigured
public boolean wasConfigured()
-
isFromConfiguredStub
public java.lang.Boolean isFromConfiguredStub()
-
getFixedDelayMilliseconds
public java.lang.Integer getFixedDelayMilliseconds()
-
getDelayDistribution
public DelayDistribution getDelayDistribution()
-
getChunkedDribbleDelay
public ChunkedDribbleDelay getChunkedDribbleDelay()
-
getProxyUrl
public java.lang.String getProxyUrl()
-
getProxyBaseUrl
public java.lang.String getProxyBaseUrl()
-
getProxyUrlPrefixToRemove
public java.lang.String getProxyUrlPrefixToRemove()
-
specifiesBodyFile
public boolean specifiesBodyFile()
-
specifiesBodyContent
public boolean specifiesBodyContent()
-
specifiesTextBodyContent
public boolean specifiesTextBodyContent()
-
specifiesBinaryBodyContent
public boolean specifiesBinaryBodyContent()
-
isProxyResponse
public boolean isProxyResponse()
-
getOriginalRequest
public Request getOriginalRequest()
-
setOriginalRequest
public void setOriginalRequest(Request originalRequest)
-
getFault
public Fault getFault()
-
getTransformers
public java.util.List<java.lang.String> getTransformers()
-
getTransformerParameters
public Parameters getTransformerParameters()
-
hasTransformer
public boolean hasTransformer(AbstractTransformer transformer)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-