-
public class PactDslRequestWithoutPath extends PactDslRequestBase
-
-
Field Summary
Fields Modifier and Type Field Description public StringrequestMethodpublic Map<String, List<String>>requestHeaderspublic Map<String, List<String>>querypublic OptionalBodyrequestBodypublic MatchingRulesrequestMatcherspublic GeneratorsrequestGeneratorsprivate List<String>commentsprivate PactSpecVersionversion
-
Constructor Summary
Constructors Constructor Description PactDslRequestWithoutPath(ConsumerPactBuilder consumerPactBuilder, PactDslWithState pactDslWithState, String description, PactDslRequestWithoutPath defaultRequestValues, PactDslResponse defaultResponseValues, PactSpecVersion version, Map<String, JsonValue> additionalMetadata)PactDslRequestWithoutPath(ConsumerPactBuilder consumerPactBuilder, PactDslWithState pactDslWithState, String description, PactDslRequestWithoutPath defaultRequestValues, PactDslResponse defaultResponseValues, Map<String, JsonValue> additionalMetadata)
-
Method Summary
Modifier and Type Method Description final List<String>getComments()final UnitsetComments(List<String> comments)final PactSpecVersiongetVersion()final UnitsetVersion(PactSpecVersion version)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, 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 PactDslRequestWithoutPathbody(MultipartEntityBuilder body)The body of the request 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 PactDslRequestWithPathmatchPath(String pathRegex)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 PactDslRequestWithoutPathqueryMatchingISODate(String field)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 PactDslRequestWithoutPathqueryMatchingISODatetime(String field)Matches a datetime field using the ISO pattern. final PactDslRequestWithoutPathaddMetadataValue(String key, String value)Adds additional values to the metadata section of the Pact file final PactDslRequestWithoutPathaddMetadataValue(String key, JsonValue value)Adds additional values to the metadata section of the Pact file -
-
Constructor Detail
-
PactDslRequestWithoutPath
PactDslRequestWithoutPath(ConsumerPactBuilder consumerPactBuilder, PactDslWithState pactDslWithState, String description, PactDslRequestWithoutPath defaultRequestValues, PactDslResponse defaultResponseValues, PactSpecVersion version, Map<String, JsonValue> additionalMetadata)
-
PactDslRequestWithoutPath
PactDslRequestWithoutPath(ConsumerPactBuilder consumerPactBuilder, PactDslWithState pactDslWithState, String description, PactDslRequestWithoutPath defaultRequestValues, PactDslResponse defaultResponseValues, Map<String, JsonValue> additionalMetadata)
-
-
Method Detail
-
getComments
final List<String> getComments()
-
setComments
final Unit setComments(List<String> comments)
-
getVersion
final PactSpecVersion getVersion()
-
setVersion
final Unit setVersion(PactSpecVersion version)
-
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, 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
-
body
PactDslRequestWithoutPath body(MultipartEntityBuilder body)
The body of the request
- Parameters:
body- Built using MultipartEntityBuilder
-
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
-
matchPath
@JvmOverloads() final 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
-
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
-
queryMatchingISODate
@JvmOverloads() final PactDslRequestWithoutPath queryMatchingISODate(String field)
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 name
-
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
-
queryMatchingISODatetime
@JvmOverloads() final 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 if not provided.
- Parameters:
field- field name
-
addMetadataValue
final PactDslRequestWithoutPath addMetadataValue(String key, String value)
Adds additional values to the metadata section of the Pact file
-
addMetadataValue
final PactDslRequestWithoutPath addMetadataValue(String key, JsonValue value)
Adds additional values to the metadata section of the Pact file
-
-
-
-