public class ConsumerPactBuilder.PactDslResponse
extends java.lang.Object
| Constructor and Description |
|---|
PactDslResponse(ConsumerPactBuilder.PactDslRequestWithPath existing) |
| Modifier and Type | Method and Description |
|---|---|
ConsumerPactBuilder.PactDslResponse |
body(org.w3c.dom.Document body)
Response body to return
|
ConsumerPactBuilder.PactDslResponse |
body(DslPart body)
Response body to return
|
ConsumerPactBuilder.PactDslResponse |
body(org.json.JSONObject body)
Response body to return
|
ConsumerPactBuilder.PactDslResponse |
body(java.lang.String body)
Response body to return
|
ConsumerPactBuilder.PactDslResponse |
body(java.lang.String body,
org.apache.http.entity.ContentType mimeType)
Response body to return
|
ConsumerPactBuilder.PactDslResponse |
body(java.lang.String body,
java.lang.String mimeType)
Response body to return
|
ConsumerPactBuilder.PactDslResponse |
headers(java.util.Map<java.lang.String,java.lang.String> headers)
Response headers to return
|
ConsumerPactBuilder.PactDslResponse |
matchHeader(java.lang.String header,
java.lang.String regexp)
Match a response header.
|
ConsumerPactBuilder.PactDslResponse |
matchHeader(java.lang.String header,
java.lang.String regexp,
java.lang.String headerExample)
Match a response header.
|
ConsumerPactBuilder.PactDslResponse |
status(int status)
Response status code
|
au.com.dius.pact.model.PactFragment |
toFragment()
Terminates the DSL and builds a pact fragment to represent the interactions
|
ConsumerPactBuilder.PactDslRequestWithPath |
uponReceiving(java.lang.String description)
Description of the request that is expected to be received
|
public PactDslResponse(ConsumerPactBuilder.PactDslRequestWithPath existing)
public ConsumerPactBuilder.PactDslResponse status(int status)
status - HTTP status codepublic ConsumerPactBuilder.PactDslResponse headers(java.util.Map<java.lang.String,java.lang.String> headers)
headers - key-value pairs of headerspublic ConsumerPactBuilder.PactDslResponse body(java.lang.String body)
body - Response body in string formpublic ConsumerPactBuilder.PactDslResponse body(java.lang.String body, java.lang.String mimeType)
body - body in string formpublic ConsumerPactBuilder.PactDslResponse body(java.lang.String body, org.apache.http.entity.ContentType mimeType)
body - body in string formpublic ConsumerPactBuilder.PactDslResponse body(org.json.JSONObject body)
body - Response body in JSON formpublic ConsumerPactBuilder.PactDslResponse body(DslPart body)
body - Response body built using the Pact body DSLpublic ConsumerPactBuilder.PactDslResponse body(org.w3c.dom.Document body) throws javax.xml.transform.TransformerException
body - Response body as an XML Documentjavax.xml.transform.TransformerExceptionpublic ConsumerPactBuilder.PactDslResponse matchHeader(java.lang.String header, java.lang.String regexp)
header - Header to matchregexp - Regular expression to matchpublic ConsumerPactBuilder.PactDslResponse matchHeader(java.lang.String header, java.lang.String regexp, java.lang.String headerExample)
header - Header to matchregexp - Regular expression to matchheaderExample - Example value to usepublic au.com.dius.pact.model.PactFragment toFragment()
public ConsumerPactBuilder.PactDslRequestWithPath uponReceiving(java.lang.String description)
description - request description