-
public class PactDslRequestWithoutPath extends PactDslRequestBase
-
-
Field Summary
Fields Modifier and Type Field Description private StringrequestMethodprivate Map<String, List<String>>requestHeadersprivate Map<String, List<String>>queryprivate OptionalBodyrequestBodyprivate MatchingRulesrequestMatchersprivate GeneratorsrequestGeneratorsprivate List<String>commentsprivate PactSpecVersionversion
-
Constructor Summary
Constructors Constructor Description PactDslRequestWithoutPath(ConsumerPactBuilder consumerPactBuilder, PactDslWithState pactDslWithState, String description, PactDslRequestWithoutPath defaultRequestValues, PactDslResponse defaultResponseValues, PactSpecVersion version)
-
Method Summary
Modifier and Type Method Description final PactDslRequestWithoutPathmethod(String method)The HTTP method for the request final PactDslRequestWithoutPathheaders(Map<String, String> headers)Headers to be included in the request final PactDslRequestWithoutPathheaders(String firstHeaderName, String firstHeaderValue, Array<out String> headerNameValuePairs)Headers to be included in the request final PactDslRequestWithoutPathquery(String query)The query string for the request final PactDslRequestWithoutPathbody(String body)The body of the request final PactDslRequestWithoutPathbody(String body, String contentType)The body of the request final PactDslRequestWithoutPathbody(String body, ContentType contentType)The body of the request final PactDslRequestWithoutPathbody(Supplier<String> body)The body of the request final PactDslRequestWithoutPathbody(Supplier<String> body, String contentType)The body of the request final PactDslRequestWithoutPathbody(Supplier<String> body, ContentType contentType)The body of the request final PactDslRequestWithoutPathbody(JSONObject body)The body of the request final PactDslRequestWithoutPathbody(DslPart body)The body of the request final PactDslRequestWithoutPathbody(Document body)The body of the request final PactDslRequestWithoutPathbody(PactXmlBuilder xmlBuilder)XML Response body to return final 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. final 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. final 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. final PactDslRequestWithPathpath(String path)The path of the request final PactDslRequestWithPathmatchPath(String pathRegex, String path)The path of the request. final PactDslRequestWithoutPathwithFileUpload(String partName, String fileName, String fileContentType, ByteArray data)Sets up a file upload request. final PactDslRequestWithoutPathheaderFromProviderState(String name, String expression, String example)Adds a header that will have it's value injected from the provider state final PactDslRequestWithoutPathqueryParameterFromProviderState(String name, String expression, String example)Adds a query parameter that will have it's value injected from the provider state final PactDslRequestWithPathpathFromProviderState(String expression, String example)Sets the path to have it's value injected from the provider state final PactDslRequestWithoutPathqueryMatchingDate(String field, String pattern, String example)Matches a date field using the provided date pattern final PactDslRequestWithoutPathqueryMatchingDate(String field, String pattern)Matches a date field using the provided date pattern. final PactDslRequestWithoutPathqueryMatchingTime(String field, String pattern, String example)Matches a time field using the provided time pattern final PactDslRequestWithoutPathqueryMatchingTime(String field, String pattern)Matches a time field using the provided time pattern. final PactDslRequestWithoutPathqueryMatchingTime(String field)Matches a time field using the ISO time pattern. final PactDslRequestWithoutPathqueryMatchingDatetime(String field, String pattern, String example)Matches a datetime field using the provided pattern final PactDslRequestWithoutPathqueryMatchingDatetime(String field, String pattern)Matches a datetime field using the provided pattern. final PactDslRequestWithoutPathqueryMatchingISODate(String field, String example)Matches a date field using the ISO date pattern. final PactDslRequestWithoutPathqueryMatchingISOTime(String field, String example)Matches a time field using the ISO time pattern final PactDslRequestWithoutPathqueryMatchingISODatetime(String field, String example)Matches a datetime field using the ISO pattern. final StringgetRequestMethod()final Map<String, List<String>>getRequestHeaders()final Map<String, List<String>>getQuery()final OptionalBodygetRequestBody()final MatchingRulesgetRequestMatchers()final GeneratorsgetRequestGenerators()final List<String>getComments()final PactSpecVersiongetVersion()final UnitsetRequestMethod(@JvmField() String requestMethod)final UnitsetRequestHeaders(@JvmField() Map<String, List<String>> requestHeaders)final UnitsetQuery(@JvmField() Map<String, List<String>> query)final UnitsetRequestBody(@JvmField() OptionalBody requestBody)final UnitsetRequestMatchers(@JvmField() MatchingRules requestMatchers)final UnitsetRequestGenerators(@JvmField() Generators requestGenerators)final UnitsetComments(List<String> comments)final UnitsetVersion(PactSpecVersion version)-
-
Constructor Detail
-
PactDslRequestWithoutPath
PactDslRequestWithoutPath(ConsumerPactBuilder consumerPactBuilder, PactDslWithState pactDslWithState, String description, PactDslRequestWithoutPath defaultRequestValues, PactDslResponse defaultResponseValues, PactSpecVersion version)
-
-
Method Detail
-
method
final PactDslRequestWithoutPath method(String method)
The HTTP method for the request
- Parameters:
method- Valid HTTP method
-
headers
final PactDslRequestWithoutPath headers(Map<String, String> headers)
Headers to be included in the request
- Parameters:
headers- Key-value pairs
-
headers
final PactDslRequestWithoutPath headers(String firstHeaderName, String firstHeaderValue, Array<out 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
final PactDslRequestWithoutPath query(String query)
The query string for the request
- Parameters:
query- query string
-
body
final PactDslRequestWithoutPath body(String body)
The body of the request
- Parameters:
body- Request body in string form
-
body
final PactDslRequestWithoutPath body(String body, String contentType)
The body of the request
- Parameters:
body- Request body in string form
-
body
final PactDslRequestWithoutPath body(String body, ContentType contentType)
The body of the request
- Parameters:
body- Request body in string form
-
body
final 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
final 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
final 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
-
body
final PactDslRequestWithoutPath body(JSONObject body)
The body of the request
- Parameters:
body- Request body in JSON form
-
body
final PactDslRequestWithoutPath body(DslPart body)
The body of the request
- Parameters:
body- Built using the Pact body DSL
-
body
final PactDslRequestWithoutPath body(Document body)
The body of the request
- Parameters:
body- XML Document
-
body
final PactDslRequestWithoutPath body(PactXmlBuilder xmlBuilder)
XML Response body to return
- Parameters:
xmlBuilder- XML Builder used to construct the XML document
-
bodyWithSingleQuotes
final 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
final 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
final 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
-
path
final PactDslRequestWithPath path(String path)
The path of the request
- Parameters:
path- string path
-
matchPath
@JvmOverloads() final PactDslRequestWithPath matchPath(String pathRegex, String path)
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
-
withFileUpload
final PactDslRequestWithoutPath withFileUpload(String partName, String fileName, String fileContentType, ByteArray 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
final 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
final 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
final 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
final 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
final 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
final 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
final 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
-
queryMatchingTime
final 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
-
queryMatchingDatetime
final 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
final 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
@JvmOverloads() final PactDslRequestWithoutPath queryMatchingISODate(String field, String example)
Matches a date field using the ISO date pattern. The current system date will be used for the example value if not provided.
- Parameters:
field- field nameexample- Example value
-
queryMatchingISOTime
final PactDslRequestWithoutPath queryMatchingISOTime(String field, String example)
Matches a time field using the ISO time pattern
- Parameters:
field- field nameexample- Example value
-
queryMatchingISODatetime
@JvmOverloads() final PactDslRequestWithoutPath queryMatchingISODatetime(String field, String example)
Matches a datetime field using the ISO pattern. The current system date and time will be used for the example value if not provided.
- Parameters:
field- field nameexample- Example value
-
getRequestMethod
final String getRequestMethod()
-
getRequestHeaders
final Map<String, List<String>> getRequestHeaders()
-
getRequestBody
final OptionalBody getRequestBody()
-
getRequestMatchers
final MatchingRules getRequestMatchers()
-
getRequestGenerators
final Generators getRequestGenerators()
-
getComments
final List<String> getComments()
-
getVersion
final PactSpecVersion getVersion()
-
setRequestMethod
final Unit setRequestMethod(@JvmField() String requestMethod)
-
setRequestHeaders
final Unit setRequestHeaders(@JvmField() Map<String, List<String>> requestHeaders)
-
setRequestBody
final Unit setRequestBody(@JvmField() OptionalBody requestBody)
-
setRequestMatchers
final Unit setRequestMatchers(@JvmField() MatchingRules requestMatchers)
-
setRequestGenerators
final Unit setRequestGenerators(@JvmField() Generators requestGenerators)
-
setComments
final Unit setComments(List<String> comments)
-
setVersion
final Unit setVersion(PactSpecVersion version)
-
-
-
-