Class ResponseDefinitionBuilder
- java.lang.Object
-
- com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
-
- Direct Known Subclasses:
ResponseDefinitionBuilder.ProxyResponseDefinitionBuilder
public class ResponseDefinitionBuilder extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResponseDefinitionBuilder.ProxyResponseDefinitionBuilder
-
Field Summary
Fields Modifier and Type Field Description protected Body
body
protected java.lang.String
bodyFileName
protected ChunkedDribbleDelay
chunkedDribbleDelay
protected DelayDistribution
delayDistribution
protected Fault
fault
protected java.lang.Integer
fixedDelayMilliseconds
protected java.util.List<HttpHeader>
headers
protected java.lang.String
proxyBaseUrl
protected java.lang.String
proxyUrlPrefixToRemove
protected java.util.List<java.lang.String>
responseTransformerNames
protected int
status
protected java.lang.String
statusMessage
protected java.util.Map<java.lang.String,java.lang.Object>
transformerParameters
protected java.lang.Boolean
wasConfigured
-
Constructor Summary
Constructors Constructor Description ResponseDefinitionBuilder()
-
Method Summary
-
-
-
Field Detail
-
status
protected int status
-
statusMessage
protected java.lang.String statusMessage
-
body
protected Body body
-
bodyFileName
protected java.lang.String bodyFileName
-
headers
protected java.util.List<HttpHeader> headers
-
fixedDelayMilliseconds
protected java.lang.Integer fixedDelayMilliseconds
-
delayDistribution
protected DelayDistribution delayDistribution
-
chunkedDribbleDelay
protected ChunkedDribbleDelay chunkedDribbleDelay
-
proxyBaseUrl
protected java.lang.String proxyBaseUrl
-
proxyUrlPrefixToRemove
protected java.lang.String proxyUrlPrefixToRemove
-
fault
protected Fault fault
-
responseTransformerNames
protected java.util.List<java.lang.String> responseTransformerNames
-
transformerParameters
protected java.util.Map<java.lang.String,java.lang.Object> transformerParameters
-
wasConfigured
protected java.lang.Boolean wasConfigured
-
-
Method Detail
-
like
public static ResponseDefinitionBuilder like(ResponseDefinition responseDefinition)
-
jsonResponse
public static ResponseDefinition jsonResponse(java.lang.Object body)
-
jsonResponse
public static ResponseDefinition jsonResponse(java.lang.Object body, int status)
-
but
public ResponseDefinitionBuilder but()
-
withStatus
public ResponseDefinitionBuilder withStatus(int status)
-
withHeader
public ResponseDefinitionBuilder withHeader(java.lang.String key, java.lang.String... values)
-
withBodyFile
public ResponseDefinitionBuilder withBodyFile(java.lang.String fileName)
-
withBody
public ResponseDefinitionBuilder withBody(java.lang.String body)
-
withBody
public ResponseDefinitionBuilder withBody(byte[] body)
-
withResponseBody
public ResponseDefinitionBuilder withResponseBody(Body body)
-
withJsonBody
public ResponseDefinitionBuilder withJsonBody(com.fasterxml.jackson.databind.JsonNode jsonBody)
-
withFixedDelay
public ResponseDefinitionBuilder withFixedDelay(java.lang.Integer milliseconds)
-
withRandomDelay
public ResponseDefinitionBuilder withRandomDelay(DelayDistribution distribution)
-
withLogNormalRandomDelay
public ResponseDefinitionBuilder withLogNormalRandomDelay(double medianMilliseconds, double sigma)
-
withUniformRandomDelay
public ResponseDefinitionBuilder withUniformRandomDelay(int lowerMilliseconds, int upperMilliseconds)
-
withChunkedDribbleDelay
public ResponseDefinitionBuilder withChunkedDribbleDelay(int numberOfChunks, int totalDuration)
-
withTransformers
public ResponseDefinitionBuilder withTransformers(java.lang.String... responseTransformerNames)
-
withTransformerParameters
public ResponseDefinitionBuilder withTransformerParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
-
withTransformerParameter
public ResponseDefinitionBuilder withTransformerParameter(java.lang.String name, java.lang.Object value)
-
withTransformer
public ResponseDefinitionBuilder withTransformer(java.lang.String transformerName, java.lang.String parameterKey, java.lang.Object parameterValue)
-
proxiedFrom
public ResponseDefinitionBuilder.ProxyResponseDefinitionBuilder proxiedFrom(java.lang.String proxyBaseUrl)
-
responseDefinition
public static ResponseDefinitionBuilder responseDefinition()
-
okForJson
public static <T> ResponseDefinitionBuilder okForJson(T body)
-
okForEmptyJson
public static <T> ResponseDefinitionBuilder okForEmptyJson()
-
withHeaders
public ResponseDefinitionBuilder withHeaders(HttpHeaders headers)
-
withBase64Body
public ResponseDefinitionBuilder withBase64Body(java.lang.String base64Body)
-
withStatusMessage
public ResponseDefinitionBuilder withStatusMessage(java.lang.String message)
-
withFault
public ResponseDefinitionBuilder withFault(Fault fault)
-
build
public ResponseDefinition build()
-
build
protected ResponseDefinition build(HttpHeaders additionalProxyRequestHeaders, java.lang.String proxyUrlPrefixToRemove)
-
-