public class PactDslRequestWithPath extends PactDslRequestBase
CONTENT_TYPE, defaultRequestValues, query, requestBody, requestGenerators, requestHeaders, requestMatchers, requestMethod
Modifier and Type | Method and Description |
---|---|
PactDslRequestWithPath |
body(BodyBuilder builder)
Sets the body using the buidler
|
PactDslRequestWithPath |
body(org.w3c.dom.Document body)
The body of the request
|
PactDslRequestWithPath |
body(DslPart body)
The body of the request
|
PactDslRequestWithPath |
body(org.json.JSONObject body)
The body of the request
|
PactDslRequestWithPath |
body(org.apache.http.entity.mime.MultipartEntityBuilder body)
The body of the request
|
PactDslRequestWithPath |
body(au.com.dius.pact.consumer.xml.PactXmlBuilder xmlBuilder)
XML body to return
|
PactDslRequestWithPath |
body(java.lang.String body)
The body of the request
|
PactDslRequestWithPath |
body(java.lang.String body,
org.apache.http.entity.ContentType contentType)
The body of the request
|
PactDslRequestWithPath |
body(java.lang.String body,
java.lang.String contentType)
The body of the request
|
PactDslRequestWithPath |
body(java.util.function.Supplier<java.lang.String> body)
The body of the request
|
PactDslRequestWithPath |
body(java.util.function.Supplier<java.lang.String> body,
org.apache.http.entity.ContentType contentType)
The body of the request
|
PactDslRequestWithPath |
body(java.util.function.Supplier<java.lang.String> body,
java.lang.String contentType)
The body of the request
|
PactDslRequestWithPath |
bodyWithSingleQuotes(java.lang.String body)
The body of the request with possible single quotes as delimiters
and using
QuoteUtil to convert single quotes to double quotes if required. |
PactDslRequestWithPath |
bodyWithSingleQuotes(java.lang.String body,
org.apache.http.entity.ContentType contentType)
The body of the request with possible single quotes as delimiters
and using
QuoteUtil to convert single quotes to double quotes if required. |
PactDslRequestWithPath |
bodyWithSingleQuotes(java.lang.String body,
java.lang.String contentType)
The body of the request with possible single quotes as delimiters
and using
QuoteUtil to convert single quotes to double quotes if required. |
PactDslRequestWithPath |
encodedQuery(java.lang.String query)
The encoded query string for the request
|
PactDslRequestWithPath |
headerFromProviderState(java.lang.String name,
java.lang.String expression,
java.lang.String example)
Adds a header that will have it's value injected from the provider state
|
PactDslRequestWithPath |
headers(java.util.Map<java.lang.String,java.lang.String> headers)
Headers to be included in the request
|
PactDslRequestWithPath |
headers(java.lang.String firstHeaderName,
java.lang.String firstHeaderValue,
java.lang.String... headerNameValuePairs)
Headers to be included in the request
|
PactDslRequestWithPath |
matchHeader(java.lang.String header,
java.lang.String regex)
Match a request header.
|
PactDslRequestWithPath |
matchHeader(java.lang.String header,
java.lang.String regex,
java.lang.String headerExample)
Match a request header.
|
PactDslRequestWithPath |
matchPath(java.lang.String pathRegex)
The path of the request.
|
PactDslRequestWithPath |
matchPath(java.lang.String pathRegex,
java.lang.String path)
The path of the request
|
PactDslRequestWithPath |
matchQuery(java.lang.String parameter,
java.lang.String regex)
Match a query parameter with a regex.
|
PactDslRequestWithPath |
matchQuery(java.lang.String parameter,
java.lang.String regex,
java.util.List<java.lang.String> example)
Match a repeating query parameter with a regex.
|
PactDslRequestWithPath |
matchQuery(java.lang.String parameter,
java.lang.String regex,
java.lang.String example)
Match a query parameter with a regex.
|
PactDslRequestWithPath |
method(java.lang.String method)
The HTTP method for the request
|
PactDslRequestWithPath |
path(java.lang.String path)
The path of the request
|
PactDslRequestWithPath |
pathFromProviderState(java.lang.String expression,
java.lang.String example)
Sets the path to have it's value injected from the provider state
|
PactDslRequestWithPath |
query(java.lang.String query)
The query string for the request
|
PactDslRequestWithPath |
queryMatchingDate(java.lang.String field,
java.lang.String pattern)
Matches a date field using the provided date pattern.
|
PactDslRequestWithPath |
queryMatchingDate(java.lang.String field,
java.lang.String pattern,
java.lang.String example)
Matches a date field using the provided date pattern
|
PactDslRequestWithPath |
queryMatchingDatetime(java.lang.String field,
java.lang.String pattern)
Matches a datetime field using the provided pattern.
|
PactDslRequestWithPath |
queryMatchingDatetime(java.lang.String field,
java.lang.String pattern,
java.lang.String example)
Matches a datetime field using the provided pattern
|
PactDslRequestWithPath |
queryMatchingISODate(java.lang.String field)
Matches a date field using the ISO date pattern.
|
PactDslRequestWithPath |
queryMatchingISODate(java.lang.String field,
java.lang.String example)
Matches a date field using the ISO date pattern
|
PactDslRequestWithPath |
queryMatchingISODatetime(java.lang.String field)
Matches a datetime field using the ISO pattern.
|
PactDslRequestWithPath |
queryMatchingISODatetime(java.lang.String field,
java.lang.String example)
Matches a datetime field using the ISO pattern
|
PactDslRequestWithPath |
queryMatchingISOTime(java.lang.String field,
java.lang.String example)
Matches a time field using the ISO time pattern
|
PactDslRequestWithPath |
queryMatchingTime(java.lang.String field)
Matches a time field using the ISO time pattern.
|
PactDslRequestWithPath |
queryMatchingTime(java.lang.String field,
java.lang.String pattern)
Matches a time field using the provided time pattern.
|
PactDslRequestWithPath |
queryMatchingTime(java.lang.String field,
java.lang.String pattern,
java.lang.String example)
Matches a time field using the provided time pattern
|
PactDslRequestWithPath |
queryParameterFromProviderState(java.lang.String name,
java.lang.String expression,
java.lang.String example)
Adds a query parameter that will have it's value injected from the provider state
|
PactDslResponse |
willRespondWith()
Define the response to return
|
PactDslRequestWithPath |
withFileUpload(java.lang.String partName,
java.lang.String fileName,
java.lang.String fileContentType,
byte[] data)
Sets up a file upload request.
|
getContentTypeHeader, isContentTypeHeaderNotSet, queryMatchingDateBase, queryMatchingDatetimeBase, queryMatchingTimeBase, setupDefaultValues, setupFileUpload, setupMultipart
public PactDslRequestWithPath method(java.lang.String method)
method
- Valid HTTP methodpublic PactDslRequestWithPath headers(java.lang.String firstHeaderName, java.lang.String firstHeaderValue, java.lang.String... headerNameValuePairs)
firstHeaderName
- The name of the first headerfirstHeaderValue
- The value of the first headerheaderNameValuePairs
- Additional headers in name-value pairs.public PactDslRequestWithPath headers(java.util.Map<java.lang.String,java.lang.String> headers)
headers
- Key-value pairspublic PactDslRequestWithPath query(java.lang.String query)
query
- query stringpublic PactDslRequestWithPath encodedQuery(java.lang.String query)
query
- query stringpublic PactDslRequestWithPath body(java.lang.String body)
body
- Request body in string formpublic PactDslRequestWithPath body(java.lang.String body, java.lang.String contentType)
body
- Request body in string formpublic PactDslRequestWithPath body(java.lang.String body, org.apache.http.entity.ContentType contentType)
body
- Request body in string formpublic PactDslRequestWithPath body(java.util.function.Supplier<java.lang.String> body)
body
- Request body in Java Functional Interface Supplier that must return a stringpublic PactDslRequestWithPath body(java.util.function.Supplier<java.lang.String> body, java.lang.String contentType)
body
- Request body in Java Functional Interface Supplier that must return a stringpublic PactDslRequestWithPath body(java.util.function.Supplier<java.lang.String> body, org.apache.http.entity.ContentType contentType)
body
- Request body in Java Functional Interface Supplier that must return a stringpublic PactDslRequestWithPath bodyWithSingleQuotes(java.lang.String body)
QuoteUtil
to convert single quotes to double quotes if required.body
- Request body in string formpublic PactDslRequestWithPath bodyWithSingleQuotes(java.lang.String body, java.lang.String contentType)
QuoteUtil
to convert single quotes to double quotes if required.body
- Request body in string formpublic PactDslRequestWithPath bodyWithSingleQuotes(java.lang.String body, org.apache.http.entity.ContentType contentType)
QuoteUtil
to convert single quotes to double quotes if required.body
- Request body in string formpublic PactDslRequestWithPath body(org.json.JSONObject body)
body
- Request body in JSON formpublic PactDslRequestWithPath body(DslPart body)
body
- Built using the Pact body DSLpublic PactDslRequestWithPath body(org.w3c.dom.Document body) throws javax.xml.transform.TransformerException
body
- XML Documentjavax.xml.transform.TransformerException
public PactDslRequestWithPath body(au.com.dius.pact.consumer.xml.PactXmlBuilder xmlBuilder)
xmlBuilder
- XML Builder used to construct the XML documentpublic PactDslRequestWithPath body(org.apache.http.entity.mime.MultipartEntityBuilder body) throws java.io.IOException
body
- Built using MultipartEntityBuilderjava.io.IOException
public PactDslRequestWithPath path(java.lang.String path)
path
- string pathpublic PactDslRequestWithPath matchPath(java.lang.String pathRegex)
pathRegex
- string path regular expression to match withpublic PactDslRequestWithPath matchPath(java.lang.String pathRegex, java.lang.String path)
path
- string path to use when generating requestspathRegex
- regular expression to use to match pathspublic PactDslRequestWithPath matchHeader(java.lang.String header, java.lang.String regex)
header
- Header to matchregex
- Regular expression to matchpublic PactDslRequestWithPath matchHeader(java.lang.String header, java.lang.String regex, java.lang.String headerExample)
header
- Header to matchregex
- Regular expression to matchheaderExample
- Example value to usepublic PactDslResponse willRespondWith()
public PactDslRequestWithPath matchQuery(java.lang.String parameter, java.lang.String regex)
parameter
- Query parameterregex
- Regular expression to match withpublic PactDslRequestWithPath matchQuery(java.lang.String parameter, java.lang.String regex, java.lang.String example)
parameter
- Query parameterregex
- Regular expression to match withexample
- Example value to use for the query parameter (unencoded)public PactDslRequestWithPath matchQuery(java.lang.String parameter, java.lang.String regex, java.util.List<java.lang.String> example)
parameter
- Query parameterregex
- Regular expression to match with each elementexample
- Example value list to use for the query parameter (unencoded)public PactDslRequestWithPath withFileUpload(java.lang.String partName, java.lang.String fileName, java.lang.String fileContentType, byte[] data) throws java.io.IOException
partName
- This is the name of the part in the multipart body.fileName
- This is the name of the file that was uploadedfileContentType
- This is the content type of the uploaded filedata
- This is the actual file contentsjava.io.IOException
public PactDslRequestWithPath headerFromProviderState(java.lang.String name, java.lang.String expression, java.lang.String example)
name
- Header Nameexpression
- Expression to be evaluated from the provider stateexample
- Example value to use in the consumer testpublic PactDslRequestWithPath queryParameterFromProviderState(java.lang.String name, java.lang.String expression, java.lang.String example)
name
- Nameexpression
- Expression to be evaluated from the provider stateexample
- Example value to use in the consumer testpublic PactDslRequestWithPath pathFromProviderState(java.lang.String expression, java.lang.String example)
expression
- Expression to be evaluated from the provider stateexample
- Example value to use in the consumer testpublic PactDslRequestWithPath queryMatchingDate(java.lang.String field, java.lang.String pattern, java.lang.String example)
field
- field namepattern
- pattern to matchexample
- Example valuepublic PactDslRequestWithPath queryMatchingDate(java.lang.String field, java.lang.String pattern)
field
- field namepattern
- pattern to matchpublic PactDslRequestWithPath queryMatchingTime(java.lang.String field, java.lang.String pattern, java.lang.String example)
field
- field namepattern
- pattern to matchexample
- Example valuepublic PactDslRequestWithPath queryMatchingTime(java.lang.String field, java.lang.String pattern)
field
- field namepattern
- pattern to matchpublic PactDslRequestWithPath queryMatchingDatetime(java.lang.String field, java.lang.String pattern, java.lang.String example)
field
- field namepattern
- pattern to matchexample
- Example valuepublic PactDslRequestWithPath queryMatchingDatetime(java.lang.String field, java.lang.String pattern)
field
- field namepattern
- pattern to matchpublic PactDslRequestWithPath queryMatchingISODate(java.lang.String field, java.lang.String example)
field
- field nameexample
- Example valuepublic PactDslRequestWithPath queryMatchingISODate(java.lang.String field)
field
- field namepublic PactDslRequestWithPath queryMatchingISOTime(java.lang.String field, java.lang.String example)
field
- field nameexample
- Example valuepublic PactDslRequestWithPath queryMatchingTime(java.lang.String field)
field
- field namepublic PactDslRequestWithPath queryMatchingISODatetime(java.lang.String field, java.lang.String example)
field
- field nameexample
- Example valuepublic PactDslRequestWithPath queryMatchingISODatetime(java.lang.String field)
field
- field namepublic PactDslRequestWithPath body(BodyBuilder builder)
builder
- Body Builder