-
public class PactDslJsonArray extends DslPart
DSL to define a JSON array
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPactDslJsonArray.Companion
-
Constructor Summary
Constructors Constructor Description PactDslJsonArray(String rootPath, String rootName, DslPart parent, PactDslJsonArray array)Construct an array as a child copied from an existing array PactDslJsonArray(String rootPath, String rootName, DslPart parent, Boolean wildCard)Construct a array as a child PactDslJsonArray(String rootPath, String rootName, DslPart parent)Construct a array as a child PactDslJsonArray(String rootPath, String rootName)Construct a array as a child PactDslJsonArray(String rootPath)Construct a array as a child PactDslJsonArray()Construct a array as a child
-
Method Summary
Modifier and Type Method Description final JsonValuegetBody()final UnitsetBody(JsonValue body)final IntegergetNumberExamples()Sets the number of example elements to generate for sample bodies final UnitsetNumberExamples(Integer numberExamples)Sets the number of example elements to generate for sample bodies final DslPartgetParent()Returns the parent of this part (object or array) final StringgetRootPath()final StringgetRootName()final MatchingRuleCategorygetMatchers()final UnitsetMatchers(MatchingRuleCategory matchers)final GeneratorsgetGenerators()final UnitsetGenerators(Generators generators)DslPartcloseArray()Closes the current array PactDslJsonBodyeachLike(String name)Array field where each element must match the following object PactDslJsonBodyeachLike(String name, DslPart obj)Array field where each element must match the following object PactDslJsonBodyeachLike(String name, Integer numberExamples)Array field where each element must match the following object PactDslJsonBodyeachLike()Element that is an array where each item must match the following example PactDslJsonArrayeachLike(DslPart obj)Array element where each element of the array must match the provided object PactDslJsonBodyeachLike(Integer numberExamples)Element that is an array where each item must match the following example final PactDslJsonArrayeachLike(PactDslJsonRootValue value, Integer numberExamples)Array of values that are not objects where each item must match the provided example final PactDslJsonArrayeachLike(PactDslJsonRootValue value)Array of values that are not objects where each item must match the provided example PactDslJsonBodyminArrayLike(String name, Integer size)Array field with a minimum size and each element must match the following object PactDslJsonBodyminArrayLike(Integer size)Element that is an array with a minimum size where each item must match the following example PactDslJsonBodyminArrayLike(String name, Integer size, DslPart obj)Array field with a minimum size and each element must match the provided object PactDslJsonArrayminArrayLike(Integer size, DslPart obj)Array element with a minumum size and each element of the array must match the provided object PactDslJsonBodyminArrayLike(String name, Integer size, Integer numberExamples)Array field with a minumum size and each element must match the following object PactDslJsonBodyminArrayLike(Integer size, Integer numberExamples)Element that is an array with a minimum size where each item must match the following example final PactDslJsonArrayminArrayLike(Integer size, PactDslJsonRootValue value, Integer numberExamples)Array of values with a minimum size that are not objects where each item must match the provided example final PactDslJsonArrayminArrayLike(Integer size, PactDslJsonRootValue value)Array of values with a minimum size that are not objects where each item must match the provided example PactDslJsonBodymaxArrayLike(String name, Integer size)Array field with a maximum size and each element must match the following object PactDslJsonBodymaxArrayLike(Integer size)Element that is an array with a maximum size where each item must match the following example PactDslJsonBodymaxArrayLike(String name, Integer size, DslPart obj)Array field with a maximum size and each element must match the provided object PactDslJsonArraymaxArrayLike(Integer size, DslPart obj)Array element with a maximum size and each element of the array must match the provided object PactDslJsonBodymaxArrayLike(String name, Integer size, Integer numberExamples)Array field with a maximum size and each element must match the following object PactDslJsonBodymaxArrayLike(Integer size, Integer numberExamples)Element that is an array with a maximum size where each item must match the following example final PactDslJsonArraymaxArrayLike(Integer size, PactDslJsonRootValue value, Integer numberExamples)Array of values with a maximum size that are not objects where each item must match the provided example final PactDslJsonArraymaxArrayLike(Integer size, PactDslJsonRootValue value)Array of values with a maximum size that are not objects where each item must match the provided example UnitputObjectPrivate(DslPart obj)UnitputArrayPrivate(DslPart obj)final PactDslJsonArraystringValue(String value)Element that must be the specified value final PactDslJsonArraystring(String value)Element that must be the specified value final PactDslJsonArraynumberValue(Number value)final PactDslJsonArraynumber(Number value)Element that must be the specified value final PactDslJsonArraybooleanValue(Boolean value)Element that must be the specified value final PactDslJsonArraylike(Object example)Element that must be the same type as the example final PactDslJsonArraystringType()Element that can be any string final PactDslJsonArraystringType(String example)Element that can be any string final PactDslJsonArraynumberType()Element that can be any number final PactDslJsonArraynumberType(Number number)Element that can be any number final PactDslJsonArrayintegerType()Element that must be an integer final PactDslJsonArrayintegerType(Long number)Element that must be an integer final PactDslJsonArraydecimalType()Element that must be a decimal value final PactDslJsonArraydecimalType(BigDecimal number)Element that must be a decimalType value final PactDslJsonArraydecimalType(Double number)Attribute that must be a decimalType value final PactDslJsonArraybooleanType()Element that must be a boolean final PactDslJsonArraybooleanType(Boolean example)Element that must be a boolean final PactDslJsonArraystringMatcher(String regex, String value)Element that must match the regular expression final PactDslJsonArraydatetime()Element that must be an ISO formatted timestamp final PactDslJsonArraydatetime(String format)Element that must match the given timestamp format final PactDslJsonArraydatetime(String format, Date example)Element that must match the given timestamp format final PactDslJsonArraydatetime(String format, Instant example)Element that must match the given timestamp format final PactDslJsonArraydate()Element that must be formatted as an ISO date final PactDslJsonArraydate(String format)Element that must match the provided date format final PactDslJsonArraydate(String format, Date example)Element that must match the provided date format final PactDslJsonArraytime()Element that must be an ISO formatted time final PactDslJsonArraytime(String format)Element that must match the given time format final PactDslJsonArraytime(String format, Date example)Element that must match the given time format final PactDslJsonArrayipAddress()Element that must be an IP4 address PactDslJsonBodyobject(String name)Object field PactDslJsonBodyobject()Element that is a JSON object DslPartcloseObject()Close off the previous object DslPartclose()This closes off the object graph build from the DSL in case any closeObject|Array methods have not been called. DslPartarrayContaining(String name)Matches the items in an array against a number of variants. PactDslJsonArrayarray(String name)Field which is an array PactDslJsonArrayarray()Element that is a JSON array PactDslJsonArrayunorderedArray(String name)Array field where order is ignored PactDslJsonArrayunorderedArray()Array element where order is ignored PactDslJsonArrayunorderedMinArray(String name, Integer size)Array field of min size where order is ignored PactDslJsonArrayunorderedMinArray(Integer size)Array element of min size where order is ignored PactDslJsonArrayunorderedMaxArray(String name, Integer size)Array field of max size where order is ignored PactDslJsonArrayunorderedMaxArray(Integer size)Array element of max size where order is ignored PactDslJsonArrayunorderedMinMaxArray(String name, Integer minSize, Integer maxSize)Array field of min and max size where order is ignored PactDslJsonArrayunorderedMinMaxArray(Integer minSize, Integer maxSize)Array element of min and max size where order is ignored final PactDslJsonArraywildcardArrayMatcher(MatchingRule rule)Matches rule for all elements in array final PactDslJsonArrayid()Element that must be a numeric identifier final PactDslJsonArrayid(Long id)Element that must be a numeric identifier final PactDslJsonArrayhexValue()Element that must be encoded as a hexadecimal value final PactDslJsonArrayhexValue(String hexValue)Element that must be encoded as a hexadecimal value final PactDslJsonArrayuuid()Element that must be encoded as an UUID final PactDslJsonArrayuuid(String uuid)Element that must be encoded as an UUID final PactDslJsonArraytemplate(DslPart template)Adds the template object to the array final PactDslJsonArraytemplate(DslPart template, Integer occurrences)Adds a number of template objects to the array StringtoString()final PactDslJsonArraynullValue()Adds a null value to the list PactDslJsonArrayeachArrayLike(String name)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayLike(String name, Integer numberExamples)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayLike()Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayLike(Integer numberExamples)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMaxLike(String name, Integer size)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMaxLike(String name, Integer numberExamples, Integer size)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMaxLike(Integer size)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMaxLike(Integer numberExamples, Integer size)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMinLike(String name, Integer size)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMinLike(String name, Integer numberExamples, Integer size)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMinLike(Integer size)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMinLike(Integer numberExamples, Integer size)Array element where each element of the array is an array and must match the following object final PactDslJsonArrayincludesStr(String value)List item that must include the provided string final PactDslJsonArrayequalsTo(Object value)Attribute that must be equal to the provided value. final PactDslJsonArrayand(Object value, MatchingRule rules)Combine all the matchers using AND final PactDslJsonArrayor(Object value, MatchingRule rules)Combine all the matchers using OR PactDslJsonArraymatchUrl(String basePath, Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions DslPartmatchUrl(String name, String basePath, Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions PactDslJsonBodymatchUrl2(String name, Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions. DslPartmatchUrl2(Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions. PactDslJsonBodyminMaxArrayLike(String name, Integer minSize, Integer maxSize)Array field with a minimum and maximum size and each element must match the following object PactDslJsonBodyminMaxArrayLike(String name, Integer minSize, Integer maxSize, DslPart obj)Array field with a minimum and maximum size and each element must match the provided object PactDslJsonBodyminMaxArrayLike(Integer minSize, Integer maxSize)Array element with a minimum and maximum size and each element of the array must match the following object PactDslJsonArrayminMaxArrayLike(Integer minSize, Integer maxSize, DslPart obj)Array element with a minimum and maximum size and each element of the array must match the provided object PactDslJsonBodyminMaxArrayLike(String name, Integer minSize, Integer maxSize, Integer numberExamples)Array field with a minimum and maximum size and each element must match the following object PactDslJsonBodyminMaxArrayLike(Integer minSize, Integer maxSize, Integer numberExamples)Array element with a minimum and maximum size and each element of the array must match the following object PactDslJsonArrayeachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMinMaxLike(Integer minSize, Integer maxSize)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMinMaxLike(String name, Integer numberExamples, Integer minSize, Integer maxSize)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMinMaxLike(Integer numberExamples, Integer minSize, Integer maxSize)Array element where each element of the array is an array and must match the following object final PactDslJsonArrayvalueFromProviderState(String expression, Object example)Adds an element that will have it's value injected from the provider state final PactDslJsonArraydateExpression(String expression, String format)Adds a date value with the value generated by the date expression final PactDslJsonArraydateExpression(String expression)Adds a date value with the value generated by the date expression final PactDslJsonArraytimeExpression(String expression, String format)Adds a time value with the value generated by the time expression final PactDslJsonArraytimeExpression(String expression)Adds a time value with the value generated by the time expression final PactDslJsonArraydatetimeExpression(String expression, String format)Adds a datetime value with the value generated by the expression final PactDslJsonArraydatetimeExpression(String expression)Adds a datetime value with the value generated by the expression -
-
Constructor Detail
-
PactDslJsonArray
PactDslJsonArray(String rootPath, String rootName, DslPart parent, PactDslJsonArray array)
Construct an array as a child copied from an existing array- Parameters:
rootPath- Path to the child arrayrootName- Name to associate the child asparent- Parent to attach the child toarray- Array to copy
-
PactDslJsonArray
PactDslJsonArray(String rootPath, String rootName, DslPart parent, Boolean wildCard)
Construct a array as a child- Parameters:
rootPath- Path to the child arrayrootName- Name to associate the child asparent- Parent to attach the child towildCard- If it should be matched as a wild card
-
PactDslJsonArray
PactDslJsonArray(String rootPath, String rootName, DslPart parent)
Construct a array as a child- Parameters:
rootPath- Path to the child arrayrootName- Name to associate the child asparent- Parent to attach the child to
-
PactDslJsonArray
PactDslJsonArray(String rootPath, String rootName)
Construct a array as a child- Parameters:
rootPath- Path to the child arrayrootName- Name to associate the child as
-
PactDslJsonArray
PactDslJsonArray(String rootPath)
Construct a array as a child- Parameters:
rootPath- Path to the child array
-
PactDslJsonArray
PactDslJsonArray()
Construct a array as a child
-
-
Method Detail
-
getBody
final JsonValue getBody()
-
getNumberExamples
final Integer getNumberExamples()
Sets the number of example elements to generate for sample bodies
-
setNumberExamples
final Unit setNumberExamples(Integer numberExamples)
Sets the number of example elements to generate for sample bodies
-
getRootPath
final String getRootPath()
-
getRootName
final String getRootName()
-
getMatchers
final MatchingRuleCategory getMatchers()
-
setMatchers
final Unit setMatchers(MatchingRuleCategory matchers)
-
getGenerators
final Generators getGenerators()
-
setGenerators
final Unit setGenerators(Generators generators)
-
closeArray
DslPart closeArray()
Closes the current array
-
eachLike
PactDslJsonBody eachLike(String name)
Array field where each element must match the following object
- Parameters:
name- field name
-
eachLike
PactDslJsonBody eachLike(String name, DslPart obj)
Array field where each element must match the following object
- Parameters:
name- field name
-
eachLike
PactDslJsonBody eachLike(String name, Integer numberExamples)
Array field where each element must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generate
-
eachLike
PactDslJsonBody eachLike()
Element that is an array where each item must match the following example
-
eachLike
PactDslJsonArray eachLike(DslPart obj)
Array element where each element of the array must match the provided object
-
eachLike
PactDslJsonBody eachLike(Integer numberExamples)
Element that is an array where each item must match the following example
- Parameters:
numberExamples- Number of examples to generate
-
eachLike
@JvmOverloads() final PactDslJsonArray eachLike(PactDslJsonRootValue value, Integer numberExamples)
Array of values that are not objects where each item must match the provided example
- Parameters:
value- Value to use to match each item
-
eachLike
@JvmOverloads() final PactDslJsonArray eachLike(PactDslJsonRootValue value)
Array of values that are not objects where each item must match the provided example
- Parameters:
value- Value to use to match each item
-
minArrayLike
PactDslJsonBody minArrayLike(String name, Integer size)
Array field with a minimum size and each element must match the following object
- Parameters:
name- field namesize- minimum size
-
minArrayLike
PactDslJsonBody minArrayLike(Integer size)
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
PactDslJsonBody minArrayLike(String name, Integer size, DslPart obj)
Array field with a minimum size and each element must match the provided object
- Parameters:
name- field namesize- minimum size
-
minArrayLike
PactDslJsonArray minArrayLike(Integer size, DslPart obj)
Array element with a minumum size and each element of the array must match the provided object
- Parameters:
size- minimum size
-
minArrayLike
PactDslJsonBody minArrayLike(String name, Integer size, Integer numberExamples)
Array field with a minumum size and each element must match the following object
- Parameters:
name- field namesize- minimum sizenumberExamples- number of examples to generate
-
minArrayLike
PactDslJsonBody minArrayLike(Integer size, Integer numberExamples)
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
-
minArrayLike
@JvmOverloads() final PactDslJsonArray minArrayLike(Integer size, PactDslJsonRootValue value, Integer numberExamples)
Array of values with a minimum size that are not objects where each item must match the provided example
- Parameters:
size- minimum size of the arrayvalue- Value to use to match each itemnumberExamples- number of examples to generate
-
minArrayLike
@JvmOverloads() final PactDslJsonArray minArrayLike(Integer size, PactDslJsonRootValue value)
Array of values with a minimum size that are not objects where each item must match the provided example
- Parameters:
size- minimum size of the arrayvalue- Value to use to match each item
-
maxArrayLike
PactDslJsonBody maxArrayLike(String name, Integer size)
Array field with a maximum size and each element must match the following object
- Parameters:
name- field namesize- maximum size
-
maxArrayLike
PactDslJsonBody maxArrayLike(Integer size)
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
PactDslJsonBody maxArrayLike(String name, Integer size, DslPart obj)
Array field with a maximum size and each element must match the provided object
- Parameters:
name- field namesize- maximum size
-
maxArrayLike
PactDslJsonArray maxArrayLike(Integer size, DslPart obj)
Array element with a maximum size and each element of the array must match the provided object
- Parameters:
size- minimum size
-
maxArrayLike
PactDslJsonBody maxArrayLike(String name, Integer size, Integer numberExamples)
Array field with a maximum size and each element must match the following object
- Parameters:
name- field namesize- maximum sizenumberExamples- number of examples to generate
-
maxArrayLike
PactDslJsonBody maxArrayLike(Integer size, Integer numberExamples)
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
-
maxArrayLike
@JvmOverloads() final PactDslJsonArray maxArrayLike(Integer size, PactDslJsonRootValue value, Integer numberExamples)
Array of values with a maximum size that are not objects where each item must match the provided example
- Parameters:
size- maximum size of the arrayvalue- Value to use to match each itemnumberExamples- number of examples to generate
-
maxArrayLike
@JvmOverloads() final PactDslJsonArray maxArrayLike(Integer size, PactDslJsonRootValue value)
Array of values with a maximum size that are not objects where each item must match the provided example
- Parameters:
size- maximum size of the arrayvalue- Value to use to match each item
-
putObjectPrivate
Unit putObjectPrivate(DslPart obj)
-
putArrayPrivate
Unit putArrayPrivate(DslPart obj)
-
stringValue
final PactDslJsonArray stringValue(String value)
Element that must be the specified value
- Parameters:
value- string value
-
string
final PactDslJsonArray string(String value)
Element that must be the specified value
- Parameters:
value- string value
-
numberValue
final PactDslJsonArray numberValue(Number value)
-
number
final PactDslJsonArray number(Number value)
Element that must be the specified value
- Parameters:
value- number value
-
booleanValue
final PactDslJsonArray booleanValue(Boolean value)
Element that must be the specified value
- Parameters:
value- boolean value
-
like
final PactDslJsonArray like(Object example)
Element that must be the same type as the example
-
stringType
final PactDslJsonArray stringType()
Element that can be any string
-
stringType
final PactDslJsonArray stringType(String example)
Element that can be any string
- Parameters:
example- example value to use for generated bodies
-
numberType
final PactDslJsonArray numberType()
Element that can be any number
-
numberType
final PactDslJsonArray numberType(Number number)
Element that can be any number
- Parameters:
number- example number to use for generated bodies
-
integerType
final PactDslJsonArray integerType()
Element that must be an integer
-
integerType
final PactDslJsonArray integerType(Long number)
Element that must be an integer
- Parameters:
number- example integer value to use for generated bodies
-
decimalType
final PactDslJsonArray decimalType()
Element that must be a decimal value
-
decimalType
final PactDslJsonArray decimalType(BigDecimal number)
Element that must be a decimalType value
- Parameters:
number- example decimalType value
-
decimalType
final PactDslJsonArray decimalType(Double number)
Attribute that must be a decimalType value
- Parameters:
number- example decimalType value
-
booleanType
final PactDslJsonArray booleanType()
Element that must be a boolean
-
booleanType
final PactDslJsonArray booleanType(Boolean example)
Element that must be a boolean
- Parameters:
example- example boolean to use for generated bodies
-
stringMatcher
final PactDslJsonArray stringMatcher(String regex, String value)
Element that must match the regular expression
- Parameters:
regex- regular expressionvalue- example value to use for generated bodies
-
datetime
final PactDslJsonArray datetime()
Element that must be an ISO formatted timestamp
-
datetime
final PactDslJsonArray datetime(String format)
Element that must match the given timestamp format
- Parameters:
format- timestamp format
-
datetime
final PactDslJsonArray datetime(String format, Date example)
Element that must match the given timestamp format
- Parameters:
format- timestamp formatexample- example date and time to use for generated bodies
-
datetime
final PactDslJsonArray datetime(String format, Instant example)
Element that must match the given timestamp format
- Parameters:
format- timestamp formatexample- example date and time to use for generated bodies
-
date
final PactDslJsonArray date()
Element that must be formatted as an ISO date
-
date
final PactDslJsonArray date(String format)
Element that must match the provided date format
- Parameters:
format- date format to match
-
date
final PactDslJsonArray date(String format, Date example)
Element that must match the provided date format
- Parameters:
format- date format to matchexample- example date to use for generated values
-
time
final PactDslJsonArray time()
Element that must be an ISO formatted time
-
time
final PactDslJsonArray time(String format)
Element that must match the given time format
- Parameters:
format- time format to match
-
time
final PactDslJsonArray time(String format, Date example)
Element that must match the given time format
- Parameters:
format- time format to matchexample- example time to use for generated bodies
-
ipAddress
final PactDslJsonArray ipAddress()
Element that must be an IP4 address
-
object
PactDslJsonBody object(String name)
Object field
- Parameters:
name- field name
-
object
PactDslJsonBody object()
Element that is a JSON object
-
closeObject
DslPart closeObject()
Close off the previous object
-
close
DslPart close()
This closes off the object graph build from the DSL in case any closeObject|Array methods have not been called.
-
arrayContaining
DslPart arrayContaining(String name)
Matches the items in an array against a number of variants. Matching is successful if each variant occurs once in the array. Variants may be objects containing matching rules.
- Parameters:
name- Attribute name
-
array
PactDslJsonArray array(String name)
Field which is an array
- Parameters:
name- field name
-
array
PactDslJsonArray array()
Element that is a JSON array
-
unorderedArray
PactDslJsonArray unorderedArray(String name)
Array field where order is ignored
- Parameters:
name- field name
-
unorderedArray
PactDslJsonArray unorderedArray()
Array element where order is ignored
-
unorderedMinArray
PactDslJsonArray unorderedMinArray(String name, Integer size)
Array field of min size where order is ignored
- Parameters:
name- field namesize- minimum size
-
unorderedMinArray
PactDslJsonArray unorderedMinArray(Integer size)
Array element of min size where order is ignored
- Parameters:
size- minimum size
-
unorderedMaxArray
PactDslJsonArray unorderedMaxArray(String name, Integer size)
Array field of max size where order is ignored
- Parameters:
name- field namesize- maximum size
-
unorderedMaxArray
PactDslJsonArray unorderedMaxArray(Integer size)
Array element of max size where order is ignored
- Parameters:
size- maximum size
-
unorderedMinMaxArray
PactDslJsonArray unorderedMinMaxArray(String name, Integer minSize, Integer maxSize)
Array field of min and max size where order is ignored
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
unorderedMinMaxArray
PactDslJsonArray unorderedMinMaxArray(Integer minSize, Integer maxSize)
Array element of min and max size where order is ignored
- Parameters:
minSize- minimum sizemaxSize- maximum size
-
wildcardArrayMatcher
final PactDslJsonArray wildcardArrayMatcher(MatchingRule rule)
Matches rule for all elements in array
- Parameters:
rule- Matching rule to apply across array
-
id
final PactDslJsonArray id()
Element that must be a numeric identifier
-
id
final PactDslJsonArray id(Long id)
Element that must be a numeric identifier
- Parameters:
id- example id to use for generated bodies
-
hexValue
final PactDslJsonArray hexValue()
Element that must be encoded as a hexadecimal value
-
hexValue
final PactDslJsonArray hexValue(String hexValue)
Element that must be encoded as a hexadecimal value
- Parameters:
hexValue- example value to use for generated bodies
-
uuid
final PactDslJsonArray uuid()
Element that must be encoded as an UUID
-
uuid
final PactDslJsonArray uuid(String uuid)
Element that must be encoded as an UUID
- Parameters:
uuid- example UUID to use for generated bodies
-
template
final PactDslJsonArray template(DslPart template)
Adds the template object to the array
- Parameters:
template- template object
-
template
final PactDslJsonArray template(DslPart template, Integer occurrences)
Adds a number of template objects to the array
- Parameters:
template- template objectoccurrences- number to add
-
nullValue
final PactDslJsonArray nullValue()
Adds a null value to the list
-
eachArrayLike
PactDslJsonArray eachArrayLike(String name)
Array field where each element is an array and must match the following object
- Parameters:
name- field name
-
eachArrayLike
PactDslJsonArray eachArrayLike(String name, Integer numberExamples)
Array field where each element is an array and must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generate
-
eachArrayLike
PactDslJsonArray eachArrayLike()
Array element where each element of the array is an array and must match the following object
-
eachArrayLike
PactDslJsonArray eachArrayLike(Integer numberExamples)
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
PactDslJsonArray eachArrayWithMaxLike(String name, Integer size)
Array field where each element is an array and must match the following object
- Parameters:
name- field namesize- Maximum size of the outer array
-
eachArrayWithMaxLike
PactDslJsonArray eachArrayWithMaxLike(String name, Integer numberExamples, Integer size)
Array field where each element is an array and must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generatesize- Maximum size of the outer array
-
eachArrayWithMaxLike
PactDslJsonArray eachArrayWithMaxLike(Integer size)
Array element where each element of the array is an array and must match the following object
- Parameters:
size- Maximum size of the outer array
-
eachArrayWithMaxLike
PactDslJsonArray eachArrayWithMaxLike(Integer numberExamples, Integer size)
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
PactDslJsonArray eachArrayWithMinLike(String name, Integer size)
Array field where each element is an array and must match the following object
- Parameters:
name- field namesize- Minimum size of the outer array
-
eachArrayWithMinLike
PactDslJsonArray eachArrayWithMinLike(String name, Integer numberExamples, Integer size)
Array field where each element is an array and must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generatesize- Minimum size of the outer array
-
eachArrayWithMinLike
PactDslJsonArray eachArrayWithMinLike(Integer size)
Array element where each element of the array is an array and must match the following object
- Parameters:
size- Minimum size of the outer array
-
eachArrayWithMinLike
PactDslJsonArray eachArrayWithMinLike(Integer numberExamples, Integer size)
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
-
includesStr
final PactDslJsonArray includesStr(String value)
List item that must include the provided string
- Parameters:
value- Value that must be included
-
equalsTo
final PactDslJsonArray equalsTo(Object value)
Attribute that must be equal to the provided value.
- Parameters:
value- Value that will be used for comparisons
-
and
final PactDslJsonArray and(Object value, MatchingRule rules)
Combine all the matchers using AND
- Parameters:
value- Attribute example valuerules- Matching rules to apply
-
or
final PactDslJsonArray or(Object value, MatchingRule rules)
Combine all the matchers using OR
- Parameters:
value- Attribute example valuerules- Matching rules to apply
-
matchUrl
PactDslJsonArray matchUrl(String basePath, Object pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions
- Parameters:
basePath- The base path for the URL (like "http://localhost:8080/") which will be excluded from the matchingpathFragments- Series of path fragments to match on.
-
matchUrl
DslPart matchUrl(String name, String basePath, Object pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions
- Parameters:
name- Attribute namebasePath- The base path for the URL (like "http://localhost:8080/") which will be excluded from the matchingpathFragments- Series of path fragments to match on.
-
matchUrl2
PactDslJsonBody matchUrl2(String name, Object pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions. Base path from the mock server will be used.
- Parameters:
name- Attribute namepathFragments- Series of path fragments to match on.
-
matchUrl2
DslPart matchUrl2(Object pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions. Base path from the mock server will be used.
- Parameters:
pathFragments- Series of path fragments to match on.
-
minMaxArrayLike
PactDslJsonBody minMaxArrayLike(String name, Integer minSize, Integer maxSize)
Array field with a minimum and maximum size and each element must match the following object
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
minMaxArrayLike
PactDslJsonBody minMaxArrayLike(String name, Integer minSize, Integer maxSize, DslPart obj)
Array field with a minimum and maximum size and each element must match the provided object
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
minMaxArrayLike
PactDslJsonBody minMaxArrayLike(Integer minSize, Integer maxSize)
Array element with a minimum and maximum size and each element of the array must match the following object
- Parameters:
minSize- minimum sizemaxSize- maximum size
-
minMaxArrayLike
PactDslJsonArray minMaxArrayLike(Integer minSize, Integer maxSize, DslPart obj)
Array element with a minimum and maximum size and each element of the array must match the provided object
- Parameters:
minSize- minimum sizemaxSize- maximum size
-
minMaxArrayLike
PactDslJsonBody minMaxArrayLike(String name, Integer minSize, Integer maxSize, Integer numberExamples)
Array field with a minimum and maximum size and each element must match the following object
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum sizenumberExamples- number of examples to generate
-
minMaxArrayLike
PactDslJsonBody minMaxArrayLike(Integer minSize, Integer maxSize, Integer numberExamples)
Array element with a minimum and maximum size and each element of the array must match the following object
- Parameters:
minSize- minimum sizemaxSize- maximum sizenumberExamples- number of examples to generate
-
eachArrayWithMinMaxLike
PactDslJsonArray eachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize)
Array field where each element is an array and must match the following object
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
eachArrayWithMinMaxLike
PactDslJsonArray eachArrayWithMinMaxLike(Integer minSize, Integer maxSize)
Array element where each element of the array is an array and must match the following object
- Parameters:
minSize- minimum sizemaxSize- maximum size
-
eachArrayWithMinMaxLike
PactDslJsonArray eachArrayWithMinMaxLike(String name, Integer numberExamples, Integer minSize, Integer maxSize)
Array field where each element is an array and must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generateminSize- minimum sizemaxSize- maximum size
-
eachArrayWithMinMaxLike
PactDslJsonArray eachArrayWithMinMaxLike(Integer numberExamples, Integer minSize, Integer maxSize)
Array element where each element of the array is an array and must match the following object
- Parameters:
numberExamples- number of examples to generateminSize- minimum sizemaxSize- maximum size
-
valueFromProviderState
final PactDslJsonArray valueFromProviderState(String expression, Object example)
Adds an element that will have it's value injected from the provider state
- Parameters:
expression- Expression to be evaluated from the provider stateexample- Example value to be used in the consumer test
-
dateExpression
@JvmOverloads() final PactDslJsonArray dateExpression(String expression, String format)
Adds a date value with the value generated by the date expression
- Parameters:
expression- Date expression to use to generate the valuesformat- Date format to use
-
dateExpression
@JvmOverloads() final PactDslJsonArray dateExpression(String expression)
Adds a date value with the value generated by the date expression
- Parameters:
expression- Date expression to use to generate the values
-
timeExpression
@JvmOverloads() final PactDslJsonArray timeExpression(String expression, String format)
Adds a time value with the value generated by the time expression
- Parameters:
expression- Time expression to use to generate the valuesformat- Time format to use
-
timeExpression
@JvmOverloads() final PactDslJsonArray timeExpression(String expression)
Adds a time value with the value generated by the time expression
- Parameters:
expression- Time expression to use to generate the values
-
datetimeExpression
@JvmOverloads() final PactDslJsonArray datetimeExpression(String expression, String format)
Adds a datetime value with the value generated by the expression
- Parameters:
expression- Datetime expression to use to generate the valuesformat- Datetime format to use
-
datetimeExpression
@JvmOverloads() final PactDslJsonArray datetimeExpression(String expression)
Adds a datetime value with the value generated by the expression
- Parameters:
expression- Datetime expression to use to generate the values
-
-
-
-