public class PactDslRequestWithoutPath
extends PactDslRequestBase
public PactDslRequestWithoutPath(ConsumerPactBuilder consumerPactBuilder, PactDslWithState pactDslWithState, java.lang.String description, PactDslRequestWithoutPath defaultRequestValues, PactDslResponse defaultResponseValues)
public PactDslRequestWithoutPath method(java.lang.String method)
The HTTP method for the request
method - Valid HTTP methodpublic PactDslRequestWithoutPath headers(java.util.Map<java.lang.String,java.lang.String> headers)
Headers to be included in the request
headers - Key-value pairspublic PactDslRequestWithoutPath headers(java.lang.String firstHeaderName, java.lang.String firstHeaderValue, java.lang.String... headerNameValuePairs)
Headers to be included in the request
firstHeaderName - The name of the first headerfirstHeaderValue - The value of the first headerheaderNameValuePairs - Additional headers in name-value pairs.public PactDslRequestWithoutPath query(java.lang.String query)
The query string for the request
query - query stringpublic PactDslRequestWithoutPath body(java.lang.String body)
The body of the request
body - Request body in string formpublic PactDslRequestWithoutPath body(java.lang.String body, java.lang.String contentType)
The body of the request
body - Request body in string formpublic PactDslRequestWithoutPath body(java.lang.String body, org.apache.http.entity.ContentType contentType)
The body of the request
body - Request body in string formpublic PactDslRequestWithoutPath body(java.util.function.Supplier<java.lang.String> body)
The body of the request
body - Request body in Java Functional Interface Supplier that must return a stringpublic PactDslRequestWithoutPath body(java.util.function.Supplier<java.lang.String> body, java.lang.String contentType)
The body of the request
body - Request body in Java Functional Interface Supplier that must return a stringpublic PactDslRequestWithoutPath body(java.util.function.Supplier<java.lang.String> body, org.apache.http.entity.ContentType contentType)
The body of the request
body - Request body in Java Functional Interface Supplier that must return a stringpublic PactDslRequestWithoutPath bodyWithSingleQuotes(java.lang.String body)
The body of the request with possible single quotes as delimiters and using to convert single quotes to double quotes if required.class QuoteUtil
body - Request body in string formclass QuoteUtilpublic PactDslRequestWithoutPath bodyWithSingleQuotes(java.lang.String body, java.lang.String contentType)
The body of the request with possible single quotes as delimiters and using to convert single quotes to double quotes if required.class QuoteUtil
body - Request body in string formclass QuoteUtilpublic PactDslRequestWithoutPath bodyWithSingleQuotes(java.lang.String body, org.apache.http.entity.ContentType contentType)
The body of the request with possible single quotes as delimiters and using to convert single quotes to double quotes if required.class QuoteUtil
body - Request body in string formclass QuoteUtilpublic PactDslRequestWithoutPath body(org.json.JSONObject body)
The body of the request
body - Request body in JSON formpublic PactDslRequestWithoutPath body(DslPart body)
The body of the request
body - Built using the Pact body DSLpublic PactDslRequestWithoutPath body(org.w3c.dom.Document body)
The body of the request
body - XML Documentpublic PactDslRequestWithoutPath body(PactXmlBuilder xmlBuilder)
XML Response body to return
xmlBuilder - XML Builder used to construct the XML documentpublic PactDslRequestWithPath path(java.lang.String path)
The path of the request
path - string pathpublic PactDslRequestWithPath matchPath(java.lang.String pathRegex)
The path of the request. This will generate a random path to use when generating requests
pathRegex - string path regular expression to match withpublic PactDslRequestWithPath matchPath(java.lang.String pathRegex, java.lang.String path)
The path of the request
path - string path to use when generating requestspathRegex - regular expression to use to match pathspublic PactDslRequestWithoutPath withFileUpload(java.lang.String partName, java.lang.String fileName, java.lang.String fileContentType, kotlin.Array[] data)
Sets up a file upload request. This will add the correct content type header to the request
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 contentspublic PactDslRequestWithoutPath 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
name - Header Nameexpression - Expression to be evaluated from the provider stateexample - Example value to use in the consumer testpublic PactDslRequestWithoutPath 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
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)
Sets the path to have it's value injected from the provider state
expression - Expression to be evaluated from the provider stateexample - Example value to use in the consumer testpublic PactDslRequestWithoutPath queryMatchingDate(java.lang.String field, java.lang.String pattern, java.lang.String example)
Matches a date field using the provided date pattern
field - field namepattern - pattern to matchexample - Example valuepublic PactDslRequestWithoutPath queryMatchingDate(java.lang.String field, java.lang.String pattern)
Matches a date field using the provided date pattern. The current system date will be used for the example value.
field - field namepattern - pattern to matchpublic PactDslRequestWithoutPath queryMatchingTime(java.lang.String field, java.lang.String pattern, java.lang.String example)
Matches a time field using the provided time pattern
field - field namepattern - pattern to matchexample - Example valuepublic PactDslRequestWithoutPath queryMatchingTime(java.lang.String field, java.lang.String pattern)
Matches a time field using the provided time pattern. The current system time will be used for the example value.
field - field namepattern - pattern to matchpublic PactDslRequestWithoutPath queryMatchingDatetime(java.lang.String field, java.lang.String pattern, java.lang.String example)
Matches a datetime field using the provided pattern
field - field namepattern - pattern to matchexample - Example valuepublic PactDslRequestWithoutPath queryMatchingDatetime(java.lang.String field, java.lang.String pattern)
Matches a datetime field using the provided pattern. The current system date and time will be used for the example value.
field - field namepattern - pattern to matchpublic PactDslRequestWithoutPath queryMatchingISODate(java.lang.String field, java.lang.String example)
Matches a date field using the ISO date pattern
field - field nameexample - Example valuepublic PactDslRequestWithoutPath queryMatchingISODate(java.lang.String field)
Matches a date field using the ISO date pattern. The current system date will be used for the example value.
field - field namepublic PactDslRequestWithoutPath queryMatchingISOTime(java.lang.String field, java.lang.String example)
Matches a time field using the ISO time pattern
field - field nameexample - Example valuepublic PactDslRequestWithoutPath queryMatchingTime(java.lang.String field)
Matches a time field using the ISO time pattern. The current system time will be used for the example value.
field - field namepublic PactDslRequestWithoutPath queryMatchingISODatetime(java.lang.String field, java.lang.String example)
Matches a datetime field using the ISO pattern
field - field nameexample - Example valuepublic PactDslRequestWithoutPath queryMatchingISODatetime(java.lang.String field)
Matches a datetime field using the ISO pattern. The current system date and time will be used for the example value.
field - field name