Package au.com.dius.pact.consumer.dsl
Class LambdaDslJsonArray
java.lang.Object
au.com.dius.pact.consumer.dsl.LambdaDslJsonArray
-
Method Summary
Modifier and TypeMethodDescriptionCombine all the matchers using ANDElement that is a JSON arraybooleanType
(Boolean example) Element that must be a booleanbooleanValue
(Boolean value) Element that must be the specified valueau.com.dius.pact.consumer.dsl.DslPart
build()
date()
Element that must be formatted as an ISO dateElement that must match the provided date formatElement that must match the provided date formatdateExpression
(String expression) Date value generated from the provided expression.dateExpression
(String expression, String format) Date value generated from the provided expressiondatetimeExpression
(String expression) Datetime generated from the provided expression.datetimeExpression
(String expression, String format) Datetime generated from the provided expressiondecimalMatching
(String regex, Double example) Attribute that can be any number decimal number (has significant digits after the decimal point) and which must match the provided regular expressionElement that must be a decimal valuedecimalType
(Double example) Attribute that must be a decimalType valuedecimalType
(BigDecimal example) Element that must be a decimalType valueeachArrayLike
(int numberExamples, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following objecteachArrayLike
(Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following objecteachArrayWithMaxLike
(int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following objecteachArrayWithMaxLike
(Integer size, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object.eachArrayWithMinLike
(int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following objecteachArrayWithMinLike
(Integer size, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object.eachArrayWithMinMaxLike
(Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following objecteachArrayWithMinMaxLike
(Integer minSize, Integer maxSize, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object.eachLike
(int numberExamples, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array where each item must match the following exampleeachLike
(au.com.dius.pact.consumer.dsl.PactDslJsonRootValue value) Element that is an array where each item must match the following exampleeachLike
(au.com.dius.pact.consumer.dsl.PactDslJsonRootValue value, int numberExamples) Element that is an array where each item must match the following exampleeachLike
(Consumer<LambdaDslJsonBody> nestedObject) Element that is an array where each item must match the following exampleau.com.dius.pact.consumer.dsl.PactDslJsonArray
Get the rawPactDslJsonArray
which is abstracted withPactDslJsonArray
hexValue()
Element that must be encoded as a hexadecimal valueElement that must be encoded as a hexadecimal valueid()
Element that must be a numeric identifierElement that must be a numeric identifierintegerMatching
(String regex, Integer example) Attribute that can be any integer and which must match the provided regular expressionElement that must be an integerintegerType
(Long example) Element that must be an integerElement that must be an IP4 addressmaxArrayLike
(Integer size, int numberExamples, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a maximum size where each item must match the following examplemaxArrayLike
(Integer size, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a maximum size where each item must match the following exampleminArrayLike
(Integer size, int numberExamples, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a minimum size where each item must match the following exampleminArrayLike
(Integer size, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a minimum size where each item must match the following exampleminMaxArrayLike
(Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a minimum and maximum size where each item must match the following exampleminMaxArrayLike
(Integer minSize, Integer maxSize, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a minimum and maximum size where each item must match the following exampleAdds a null value to the listnumberMatching
(String regex, Number example) Attribute that can be any number and which must match the provided regular expressionnumberType
(Number example) Element that can be any numbernumberValue
(Number value) Element that must be the specified numberElement that is a JSON objectCombine all the matchers using ORstringMatcher
(String regex, String example) Element that must match the regular expressionstringType
(String example) Element that can be any stringstringValue
(String value) Element that must be the specified valuetime()
Element that must be an ISO formatted timeElement that must match the given time formatElement that must match the given time formattimeExpression
(String expression) Time value generated from the provided expression.timeExpression
(String expression, String format) Time value generated from the provided expressionDeprecated.Use datetimeDeprecated.Use datetimeDeprecated.Use datetimeDeprecated.Use datetimeArray element where order is ignoredunorderedMaxArray
(int size, Consumer<LambdaDslJsonArray> a) Array element of max size where order is ignoredunorderedMinArray
(int size, Consumer<LambdaDslJsonArray> a) Array element of min size where order is ignoredunorderedMinMaxArray
(int minSize, int maxSize, Consumer<LambdaDslJsonArray> a) Array element of min and max size where order is ignoreduuid()
Element that must be encoded as an UUIDElement that must be encoded as an UUID
-
Method Details
-
getPactDslJsonArray
public au.com.dius.pact.consumer.dsl.PactDslJsonArray getPactDslJsonArray()Get the rawPactDslJsonArray
which is abstracted withPactDslJsonArray
-
object
Element that is a JSON object -
array
Element that is a JSON array -
unorderedArray
Array element where order is ignored -
unorderedMinArray
Array element of min size where order is ignored- Parameters:
size
-
-
unorderedMaxArray
Array element of max size where order is ignored- Parameters:
size
-
-
unorderedMinMaxArray
public LambdaDslJsonArray unorderedMinMaxArray(int minSize, int maxSize, Consumer<LambdaDslJsonArray> a) Array element of min and max size where order is ignored- Parameters:
minSize
-maxSize
-
-
stringValue
Element that must be the specified value- Parameters:
value
- string value
-
stringType
Element that can be any string- Parameters:
example
- example value to use for generated bodies
-
stringMatcher
Element that must match the regular expression- Parameters:
regex
- regular expressionexample
- example value to use for generated bodies
-
numberValue
Element that must be the specified number- Parameters:
value
- number value
-
numberType
Element that can be any number- Parameters:
example
- example number to use for generated bodies
-
integerType
Element that must be an integer -
integerType
Element that must be an integer- Parameters:
example
- example integer value to use for generated bodies
-
decimalType
Element that must be a decimal value -
decimalType
Element that must be a decimalType value- Parameters:
example
- example decimalType value
-
decimalType
Attribute that must be a decimalType value- Parameters:
example
- example decimalType value
-
numberMatching
Attribute that can be any number and which must match the provided regular expression- Parameters:
regex
- Regular expression that the numbers string form must matchexample
- example number to use for generated bodies
-
decimalMatching
Attribute that can be any number decimal number (has significant digits after the decimal point) and which must match the provided regular expression- Parameters:
regex
- Regular expression that the numbers string form must matchexample
- example number to use for generated bodies
-
integerMatching
Attribute that can be any integer and which must match the provided regular expression- Parameters:
regex
- Regular expression that the numbers string form must matchexample
- example integer to use for generated bodies
-
booleanValue
Element that must be the specified value- Parameters:
value
- boolean value
-
booleanType
Element that must be a boolean- Parameters:
example
- example boolean to use for generated bodies
-
date
Element that must be formatted as an ISO date -
date
Element that must match the provided date format- Parameters:
format
- date format to match
-
date
Element that must match the provided date format- Parameters:
format
- date format to matchexample
- example date to use for generated values
-
time
Element that must be an ISO formatted time -
time
Element that must match the given time format- Parameters:
format
- time format to match
-
time
Element that must match the given time format- Parameters:
format
- time format to matchexample
- example time to use for generated bodies
-
timestamp
Deprecated.Use datetimeElement that must be an ISO formatted timestamp -
timestamp
Deprecated.Use datetimeElement that must match the given timestamp format- Parameters:
format
- timestamp format
-
timestamp
Deprecated.Use datetimeElement that must match the given timestamp format- Parameters:
format
- timestamp formatexample
- example date and time to use for generated bodies
-
timestamp
Deprecated.Use datetimeElement that must match the given timestamp format- Parameters:
format
- timestamp formatexample
- example date and time to use for generated bodies
-
id
Element that must be a numeric identifier -
id
Element that must be a numeric identifier- Parameters:
example
- example id to use for generated bodies
-
uuid
Element that must be encoded as an UUID -
uuid
Element that must be encoded as an UUID- Parameters:
example
- example UUID to use for generated bodies
-
hexValue
Element that must be encoded as a hexadecimal value -
hexValue
Element that must be encoded as a hexadecimal value- Parameters:
example
- example value to use for generated bodies
-
ipV4Address
Element that must be an IP4 address -
and
public LambdaDslJsonArray and(Object value, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules) Combine all the matchers using AND- Parameters:
value
- Attribute example valuerules
- Matching rules to apply
-
or
public LambdaDslJsonArray or(Object value, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules) Combine all the matchers using OR- Parameters:
value
- Attribute example valuerules
- Matching rules to apply
-
eachLike
Element that is an array where each item must match the following example -
eachLike
Element that is an array where each item must match the following example- Parameters:
value
- Value that each item in the array must match
-
eachLike
public LambdaDslJsonArray eachLike(au.com.dius.pact.consumer.dsl.PactDslJsonRootValue value, int numberExamples) Element that is an array where each item must match the following example- Parameters:
value
- Value that each item in the array must matchnumberExamples
- Number of examples to generate
-
eachLike
Element that is an array where each item must match the following example- Parameters:
numberExamples
- Number of examples to generate
-
minArrayLike
Element that is an array with a minimum size where each item must match the following example- Parameters:
size
- minimum size of the array
-
minArrayLike
public LambdaDslJsonArray minArrayLike(Integer size, int numberExamples, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a minimum size where each item must match the following example- Parameters:
size
- minimum size of the arraynumberExamples
- number of examples to generate
-
maxArrayLike
Element that is an array with a maximum size where each item must match the following example- Parameters:
size
- maximum size of the array
-
maxArrayLike
public LambdaDslJsonArray maxArrayLike(Integer size, int numberExamples, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a maximum size where each item must match the following example- Parameters:
size
- maximum size of the arraynumberExamples
- number of examples to generate
-
minMaxArrayLike
public LambdaDslJsonArray minMaxArrayLike(Integer minSize, Integer maxSize, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a minimum and maximum size where each item must match the following example- Parameters:
minSize
- minimum size of the arraymaxSize
- maximum size of the array
-
minMaxArrayLike
public LambdaDslJsonArray minMaxArrayLike(Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonBody> nestedObject) Element that is an array with a minimum and maximum size where each item must match the following example- Parameters:
minSize
- minimum size of the arraymaxSize
- maximum size of the arraynumberExamples
- number of examples to generate
-
nullValue
Adds a null value to the list -
eachArrayLike
Array element where each element of the array is an array and must match the following object -
eachArrayLike
public LambdaDslJsonArray eachArrayLike(int numberExamples, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object- Parameters:
numberExamples
- number of examples to generate
-
eachArrayWithMaxLike
public LambdaDslJsonArray eachArrayWithMaxLike(Integer size, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object. This will generate 1 example value, if you want to change that number useeachArrayWithMaxLike(int, Integer, Consumer)
- Parameters:
size
- Maximum size of the outer array
-
eachArrayWithMaxLike
public LambdaDslJsonArray eachArrayWithMaxLike(int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object- Parameters:
numberExamples
- number of examples to generatesize
- Maximum size of the outer array
-
eachArrayWithMinLike
public LambdaDslJsonArray eachArrayWithMinLike(Integer size, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object. This will generate 1 example value, if you want to change that number useeachArrayWithMinLike(int, Integer, Consumer)
- Parameters:
size
- Minimum size of the outer array
-
eachArrayWithMinLike
public LambdaDslJsonArray eachArrayWithMinLike(int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object- Parameters:
numberExamples
- number of examples to generatesize
- Minimum size of the outer array
-
eachArrayWithMinMaxLike
public LambdaDslJsonArray eachArrayWithMinMaxLike(Integer minSize, Integer maxSize, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object. This will generate 1 example value, if you want to change that number useeachArrayWithMinMaxLike(Integer, Integer, int, Consumer)
- Parameters:
minSize
- minimum sizemaxSize
- maximum size
-
eachArrayWithMinMaxLike
public LambdaDslJsonArray eachArrayWithMinMaxLike(Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray) Array element where each element of the array is an array and must match the following object- Parameters:
minSize
- minimum sizemaxSize
- maximum size
-
dateExpression
Date value generated from the provided expression. Will use an ISO format.- Parameters:
expression
- Date expression
-
dateExpression
Date value generated from the provided expression- Parameters:
expression
- Date expressionformat
- Date format to use for values
-
timeExpression
Time value generated from the provided expression. Will use an ISO format.- Parameters:
expression
- Time expression
-
timeExpression
Time value generated from the provided expression- Parameters:
expression
- Time expressionformat
- Time format to use for values
-
datetimeExpression
Datetime generated from the provided expression. Will use an ISO format.- Parameters:
expression
- Datetime expression
-
datetimeExpression
Datetime generated from the provided expression- Parameters:
expression
- Datetime expressionformat
- Datetime format to use for values
-
build
public au.com.dius.pact.consumer.dsl.DslPart build()
-