-
public class PactDslRequestWithoutPath extends PactDslRequestBase
-
-
Constructor Summary
Constructors Constructor Description PactDslRequestWithoutPath(ConsumerPactBuilder consumerPactBuilder, PactDslWithState pactDslWithState, String description, PactDslRequestWithoutPath defaultRequestValues, PactDslResponse defaultResponseValues)
-
Method Summary
Modifier and Type Method Description PactDslRequestWithoutPathmethod(String method)The HTTP method for the request PactDslRequestWithoutPathheaders(Map<String, String> headers)Headers to be included in the request PactDslRequestWithoutPathheaders(String firstHeaderName, String firstHeaderValue, Array<String> headerNameValuePairs)Headers to be included in the request PactDslRequestWithoutPathquery(String query)The query string for the request PactDslRequestWithoutPathbody(String body)The body of the request PactDslRequestWithoutPathbody(String body, String contentType)The body of the request PactDslRequestWithoutPathbody(String body, ContentType contentType)The body of the request PactDslRequestWithoutPathbody(Supplier<String> body)The body of the request PactDslRequestWithoutPathbody(Supplier<String> body, String contentType)The body of the request PactDslRequestWithoutPathbody(Supplier<String> body, ContentType contentType)The body of the request PactDslRequestWithoutPathbodyWithSingleQuotes(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. PactDslRequestWithoutPathbodyWithSingleQuotes(String body, 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. PactDslRequestWithoutPathbodyWithSingleQuotes(String body, 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. PactDslRequestWithoutPathbody(JSONObject body)The body of the request PactDslRequestWithoutPathbody(DslPart body)The body of the request PactDslRequestWithoutPathbody(Document body)The body of the request PactDslRequestWithoutPathbody(PactXmlBuilder xmlBuilder)XML Response body to return PactDslRequestWithPathpath(String path)The path of the request PactDslRequestWithPathmatchPath(String pathRegex)The path of the request. PactDslRequestWithPathmatchPath(String pathRegex, String path)The path of the request PactDslRequestWithoutPathwithFileUpload(String partName, String fileName, String fileContentType, Array<byte> data)Sets up a file upload request. PactDslRequestWithoutPathheaderFromProviderState(String name, String expression, String example)Adds a header that will have it's value injected from the provider state PactDslRequestWithoutPathqueryParameterFromProviderState(String name, String expression, String example)Adds a query parameter that will have it's value injected from the provider state PactDslRequestWithPathpathFromProviderState(String expression, String example)Sets the path to have it's value injected from the provider state PactDslRequestWithoutPathqueryMatchingDate(String field, String pattern, String example)Matches a date field using the provided date pattern PactDslRequestWithoutPathqueryMatchingDate(String field, String pattern)Matches a date field using the provided date pattern. PactDslRequestWithoutPathqueryMatchingTime(String field, String pattern, String example)Matches a time field using the provided time pattern PactDslRequestWithoutPathqueryMatchingTime(String field, String pattern)Matches a time field using the provided time pattern. PactDslRequestWithoutPathqueryMatchingDatetime(String field, String pattern, String example)Matches a datetime field using the provided pattern PactDslRequestWithoutPathqueryMatchingDatetime(String field, String pattern)Matches a datetime field using the provided pattern. PactDslRequestWithoutPathqueryMatchingISODate(String field, String example)Matches a date field using the ISO date pattern PactDslRequestWithoutPathqueryMatchingISODate(String field)Matches a date field using the ISO date pattern. PactDslRequestWithoutPathqueryMatchingISOTime(String field, String example)Matches a time field using the ISO time pattern PactDslRequestWithoutPathqueryMatchingTime(String field)Matches a time field using the ISO time pattern. PactDslRequestWithoutPathqueryMatchingISODatetime(String field, String example)Matches a datetime field using the ISO pattern PactDslRequestWithoutPathqueryMatchingISODatetime(String field)Matches a datetime field using the ISO pattern. -
-
Constructor Detail
-
PactDslRequestWithoutPath
PactDslRequestWithoutPath(ConsumerPactBuilder consumerPactBuilder, PactDslWithState pactDslWithState, String description, PactDslRequestWithoutPath defaultRequestValues, PactDslResponse defaultResponseValues)
-
-
Method Detail
-
method
PactDslRequestWithoutPath method(String method)
The HTTP method for the request
- Parameters:
method- Valid HTTP method
-
headers
PactDslRequestWithoutPath headers(Map<String, String> headers)
Headers to be included in the request
- Parameters:
headers- Key-value pairs
-
headers
PactDslRequestWithoutPath headers(String firstHeaderName, String firstHeaderValue, Array<String> headerNameValuePairs)
Headers to be included in the request
- Parameters:
firstHeaderName- The name of the first headerfirstHeaderValue- The value of the first headerheaderNameValuePairs- Additional headers in name-value pairs.
-
query
PactDslRequestWithoutPath query(String query)
The query string for the request
- Parameters:
query- query string
-
body
PactDslRequestWithoutPath body(String body)
The body of the request
- Parameters:
body- Request body in string form
-
body
PactDslRequestWithoutPath body(String body, String contentType)
The body of the request
- Parameters:
body- Request body in string form
-
body
PactDslRequestWithoutPath body(String body, ContentType contentType)
The body of the request
- Parameters:
body- Request body in string form
-
body
PactDslRequestWithoutPath body(Supplier<String> body)
The body of the request
- Parameters:
body- Request body in Java Functional Interface Supplier that must return a string
-
body
PactDslRequestWithoutPath body(Supplier<String> body, String contentType)
The body of the request
- Parameters:
body- Request body in Java Functional Interface Supplier that must return a string
-
body
PactDslRequestWithoutPath body(Supplier<String> body, ContentType contentType)
The body of the request
- Parameters:
body- Request body in Java Functional Interface Supplier that must return a string
-
bodyWithSingleQuotes
PactDslRequestWithoutPath bodyWithSingleQuotes(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.
- Parameters:
body- Request body in string form
-
bodyWithSingleQuotes
PactDslRequestWithoutPath bodyWithSingleQuotes(String body, 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.
- Parameters:
body- Request body in string form
-
bodyWithSingleQuotes
PactDslRequestWithoutPath bodyWithSingleQuotes(String body, 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.
- Parameters:
body- Request body in string form
-
body
PactDslRequestWithoutPath body(JSONObject body)
The body of the request
- Parameters:
body- Request body in JSON form
-
body
PactDslRequestWithoutPath body(DslPart body)
The body of the request
- Parameters:
body- Built using the Pact body DSL
-
body
PactDslRequestWithoutPath body(Document body)
The body of the request
- Parameters:
body- XML Document
-
body
PactDslRequestWithoutPath body(PactXmlBuilder xmlBuilder)
XML Response body to return
- Parameters:
xmlBuilder- XML Builder used to construct the XML document
-
path
PactDslRequestWithPath path(String path)
The path of the request
- Parameters:
path- string path
-
matchPath
PactDslRequestWithPath matchPath(String pathRegex)
The path of the request. This will generate a random path to use when generating requests
- Parameters:
pathRegex- string path regular expression to match with
-
matchPath
PactDslRequestWithPath matchPath(String pathRegex, String path)
The path of the request
- Parameters:
pathRegex- regular expression to use to match pathspath- string path to use when generating requests
-
withFileUpload
PactDslRequestWithoutPath withFileUpload(String partName, String fileName, String fileContentType, Array<byte> data)
Sets up a file upload request. This will add the correct content type header to the request
- Parameters:
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 contents
-
headerFromProviderState
PactDslRequestWithoutPath headerFromProviderState(String name, String expression, String example)
Adds a header that will have it's value injected from the provider state
- Parameters:
name- Header Nameexpression- Expression to be evaluated from the provider stateexample- Example value to use in the consumer test
-
queryParameterFromProviderState
PactDslRequestWithoutPath queryParameterFromProviderState(String name, String expression, String example)
Adds a query parameter that will have it's value injected from the provider state
- Parameters:
name- Nameexpression- Expression to be evaluated from the provider stateexample- Example value to use in the consumer test
-
pathFromProviderState
PactDslRequestWithPath pathFromProviderState(String expression, String example)
Sets the path to have it's value injected from the provider state
- Parameters:
expression- Expression to be evaluated from the provider stateexample- Example value to use in the consumer test
-
queryMatchingDate
PactDslRequestWithoutPath queryMatchingDate(String field, String pattern, String example)
Matches a date field using the provided date pattern
- Parameters:
field- field namepattern- pattern to matchexample- Example value
-
queryMatchingDate
PactDslRequestWithoutPath queryMatchingDate(String field, String pattern)
Matches a date field using the provided date pattern. The current system date will be used for the example value.
- Parameters:
field- field namepattern- pattern to match
-
queryMatchingTime
PactDslRequestWithoutPath queryMatchingTime(String field, String pattern, String example)
Matches a time field using the provided time pattern
- Parameters:
field- field namepattern- pattern to matchexample- Example value
-
queryMatchingTime
PactDslRequestWithoutPath queryMatchingTime(String field, String pattern)
Matches a time field using the provided time pattern. The current system time will be used for the example value.
- Parameters:
field- field namepattern- pattern to match
-
queryMatchingDatetime
PactDslRequestWithoutPath queryMatchingDatetime(String field, String pattern, String example)
Matches a datetime field using the provided pattern
- Parameters:
field- field namepattern- pattern to matchexample- Example value
-
queryMatchingDatetime
PactDslRequestWithoutPath queryMatchingDatetime(String field, String pattern)
Matches a datetime field using the provided pattern. The current system date and time will be used for the example value.
- Parameters:
field- field namepattern- pattern to match
-
queryMatchingISODate
PactDslRequestWithoutPath queryMatchingISODate(String field, String example)
Matches a date field using the ISO date pattern
- Parameters:
field- field nameexample- Example value
-
queryMatchingISODate
PactDslRequestWithoutPath queryMatchingISODate(String field)
Matches a date field using the ISO date pattern. The current system date will be used for the example value.
- Parameters:
field- field name
-
queryMatchingISOTime
PactDslRequestWithoutPath queryMatchingISOTime(String field, String example)
Matches a time field using the ISO time pattern
- Parameters:
field- field nameexample- Example value
-
queryMatchingTime
PactDslRequestWithoutPath queryMatchingTime(String field)
Matches a time field using the ISO time pattern. The current system time will be used for the example value.
- Parameters:
field- field name
-
queryMatchingISODatetime
PactDslRequestWithoutPath queryMatchingISODatetime(String field, String example)
Matches a datetime field using the ISO pattern
- Parameters:
field- field nameexample- Example value
-
queryMatchingISODatetime
PactDslRequestWithoutPath queryMatchingISODatetime(String field)
Matches a datetime field using the ISO pattern. The current system date and time will be used for the example value.
- Parameters:
field- field name
-
-
-
-