public class PactDslJsonBody extends DslPart
DSL to define a JSON Object
public PactDslJsonBody()
Constructs a new body as a root
public PactDslJsonBody(@NotNull
java.lang.String rootPath,
@NotNull
java.lang.String rootName,
@Nullable
DslPart parent)
Constructs a new body as a child
rootPath - Path to prefix to this childrootName - Name to associate this object as in the parentparent - Parent to attach topublic PactDslJsonBody(@NotNull
java.lang.String rootPath,
@NotNull
java.lang.String rootName,
@Nullable
DslPart parent,
@NotNull
PactDslJsonBody body)
Constructs a new body as a child as a copy of an existing one
rootPath - Path to prefix to this childrootName - Name to associate this object as in the parentparent - Parent to attach tobody - Body to copy values from@NotNull public au.com.dius.pact.core.support.json.JsonValue getBody()
public void setBody(@NotNull
au.com.dius.pact.core.support.json.JsonValue p)
@NotNull public java.lang.String toString()
public void putObjectPrivate(@NotNull
DslPart obj)
public void putArrayPrivate(@NotNull
DslPart obj)
@NotNull public PactDslJsonBody stringValue(@NotNull java.lang.String name, @Nullable java.lang.String value)
Attribute that must be the specified value
name - attribute namevalue - string value@NotNull public PactDslJsonBody numberValue(@NotNull java.lang.String name, @NotNull java.lang.Number value)
Attribute that must be the specified number
name - attribute namevalue - number value@NotNull public PactDslJsonBody booleanValue(@NotNull java.lang.String name, boolean value)
Attribute that must be the specified boolean
name - attribute namevalue - boolean value@NotNull public PactDslJsonBody like(@NotNull java.lang.String name, @NotNull java.lang.Object... examples)
Attribute that must be the same type as the example
name - attribute name@NotNull public PactDslJsonBody stringType(@NotNull java.lang.String name)
Attribute that can be any string
name - attribute name@NotNull public PactDslJsonBody stringType(@NotNull java.lang.String... names)
Attributes that can be any string
names - attribute names@NotNull public PactDslJsonBody stringType(@NotNull java.lang.String name, @NotNull java.lang.String example)
Attribute that can be any string
name - attribute nameexample - example value to use for generated bodies@NotNull public PactDslJsonBody numberType(@NotNull java.lang.String name)
Attribute that can be any number
name - attribute name@NotNull public PactDslJsonBody numberType(@NotNull java.lang.String... names)
Attributes that can be any number
names - attribute names@NotNull public PactDslJsonBody numberType(@NotNull java.lang.String name, @NotNull java.lang.Number number)
Attribute that can be any number
name - attribute namenumber - example number to use for generated bodies@NotNull public PactDslJsonBody integerType(@NotNull java.lang.String name)
Attribute that must be an integer
name - attribute name@NotNull public PactDslJsonBody integerType(@NotNull java.lang.String... names)
Attributes that must be an integer
names - attribute names@NotNull public PactDslJsonBody integerType(@NotNull java.lang.String name, long number)
Attribute that must be an integer
name - attribute namenumber - example integer value to use for generated bodies@NotNull public PactDslJsonBody integerType(@NotNull java.lang.String name, int number)
Attribute that must be an integer
name - attribute namenumber - example integer value to use for generated bodies@NotNull public PactDslJsonBody decimalType(@NotNull java.lang.String name)
Attribute that must be a decimal value
name - attribute name@NotNull public PactDslJsonBody decimalType(@NotNull java.lang.String... names)
Attributes that must be a decimal values
names - attribute names@NotNull public PactDslJsonBody decimalType(@NotNull java.lang.String name, @NotNull java.math.BigDecimal number)
Attribute that must be a decimalType value
name - attribute namenumber - example decimalType value@NotNull public PactDslJsonBody decimalType(@NotNull java.lang.String name, double number)
Attribute that must be a decimalType value
name - attribute namenumber - example decimalType value@NotNull public PactDslJsonBody booleanType(@NotNull java.lang.String... names)
Attributes that must be a boolean
names - attribute names@JvmOverloads @NotNull public PactDslJsonBody booleanType(@NotNull java.lang.String name, boolean example)
Attribute that must be a boolean
name - attribute nameexample - example boolean to use for generated bodies@JvmOverloads @NotNull public PactDslJsonBody booleanType(@NotNull java.lang.String name)
Attribute that must be a boolean
name - attribute name@NotNull public PactDslJsonBody stringMatcher(@NotNull java.lang.String name, @NotNull java.lang.String regex, @NotNull java.lang.String value)
Attribute that must match the regular expression
name - attribute nameregex - regular expressionvalue - example value to use for generated bodies@NotNull public PactDslJsonBody stringMatcher(@NotNull java.lang.String name, @NotNull java.lang.String regex)
Attribute that must match the regular expression
name - attribute nameregex - regular expression@Deprecated @NotNull public PactDslJsonBody timestamp()
Attribute named 'timestamp' that must be an ISO formatted timestamp
@Deprecated @NotNull public PactDslJsonBody timestamp(@NotNull java.lang.String name)
Attribute that must be an ISO formatted timestamp
name - @Deprecated @NotNull public PactDslJsonBody timestamp(@NotNull java.lang.String name, @NotNull java.lang.String format)
Attribute that must match the given datetime format
name - attribute nameformat - timestamp format@Deprecated @NotNull public PactDslJsonBody timestamp(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.util.Date example)
Attribute that must match the given timestamp format
name - attribute nameformat - timestamp formatexample - example date and time to use for generated bodies@Deprecated @NotNull public PactDslJsonBody timestamp(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.util.Date example, @NotNull java.util.TimeZone timeZone)
Attribute that must match the given timestamp format
name - attribute nameformat - timestamp formatexample - example date and time to use for generated bodiestimeZone - time zone used for formatting of example date and time@Deprecated @NotNull public PactDslJsonBody timestamp(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.time.Instant example)
Attribute that must match the given timestamp format
name - attribute nameformat - timestamp formatexample - example date and time to use for generated bodies@Deprecated @NotNull public PactDslJsonBody timestamp(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.time.Instant example, @NotNull java.util.TimeZone timeZone)
Attribute that must match the given timestamp format
name - attribute nameformat - timestamp formatexample - example date and time to use for generated bodiestimeZone - time zone used for formatting of example date and time@NotNull public PactDslJsonBody datetime(@NotNull java.lang.String name)
Attribute that must be an ISO formatted datetime
name - @NotNull public PactDslJsonBody datetime(@NotNull java.lang.String name, @NotNull java.lang.String format)
Attribute that must match the given datetime format
name - attribute nameformat - datetime format@JvmOverloads @NotNull public PactDslJsonBody datetime(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.util.Date example, @NotNull java.util.TimeZone timeZone)
Attribute that must match the given datetime format
name - attribute nameformat - datetime formatexample - example date and time to use for generated bodiestimeZone - time zone used for formatting of example date and time@JvmOverloads @NotNull public PactDslJsonBody datetime(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.util.Date example)
Attribute that must match the given datetime format
name - attribute nameformat - datetime formatexample - example date and time to use for generated bodies@JvmOverloads @NotNull public PactDslJsonBody datetime(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.time.Instant example, @NotNull java.util.TimeZone timeZone)
Attribute that must match the given datetime format
name - attribute nameformat - timestamp formatexample - example date and time to use for generated bodiestimeZone - time zone used for formatting of example date and time@JvmOverloads @NotNull public PactDslJsonBody datetime(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.time.Instant example)
Attribute that must match the given datetime format
name - attribute nameformat - timestamp formatexample - example date and time to use for generated bodies@JvmOverloads @NotNull public PactDslJsonBody date(@NotNull java.lang.String name)
Attribute that must be formatted as an ISO date
name - attribute name@JvmOverloads @NotNull public PactDslJsonBody date()
Attribute that must be formatted as an ISO date
@NotNull public PactDslJsonBody date(@NotNull java.lang.String name, @NotNull java.lang.String format)
Attribute that must match the provided date format
name - attribute dateformat - date format to match@JvmOverloads @NotNull public PactDslJsonBody date(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.util.Date example, @NotNull java.util.TimeZone timeZone)
Attribute that must match the provided date format
name - attribute dateformat - date format to matchexample - example date to use for generated valuestimeZone - time zone used for formatting of example date@JvmOverloads @NotNull public PactDslJsonBody date(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.util.Date example)
Attribute that must match the provided date format
name - attribute dateformat - date format to matchexample - example date to use for generated values@JvmOverloads @NotNull public PactDslJsonBody time(@NotNull java.lang.String name)
Attribute named 'time' that must be an ISO formatted time
@JvmOverloads @NotNull public PactDslJsonBody time()
Attribute named 'time' that must be an ISO formatted time
@NotNull public PactDslJsonBody time(@NotNull java.lang.String name, @NotNull java.lang.String format)
Attribute that must match the given time format
name - attribute nameformat - time format to match@JvmOverloads @NotNull public PactDslJsonBody time(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.util.Date example, @NotNull java.util.TimeZone timeZone)
Attribute that must match the given time format
name - attribute nameformat - time format to matchexample - example time to use for generated bodiestimeZone - time zone used for formatting of example time@JvmOverloads @NotNull public PactDslJsonBody time(@NotNull java.lang.String name, @NotNull java.lang.String format, @NotNull java.util.Date example)
Attribute that must match the given time format
name - attribute nameformat - time format to matchexample - example time to use for generated bodies@NotNull public PactDslJsonBody ipAddress(@NotNull java.lang.String name)
Attribute that must be an IP4 address
name - attribute name@NotNull public PactDslJsonBody object(@NotNull java.lang.String name)
Attribute that is a JSON object
name - field name@NotNull public PactDslJsonBody object()
Object element
@NotNull public PactDslJsonBody object(@NotNull java.lang.String name, @NotNull DslPart value)
Attribute that is a JSON object defined from a DSL part
name - field namevalue - DSL Part to set the value as@Nullable public DslPart closeObject()
Closes the current JSON object
@Nullable public DslPart close()
This closes off the object graph build from the DSL in case any closeObject|Array methods have not been called.
@NotNull public PactDslJsonArray array(@NotNull java.lang.String name)
Attribute that is an array
name - field name@NotNull public PactDslJsonArray array()
Element as an array
@Nullable public DslPart closeArray()
Closes the current array
@NotNull public PactDslJsonBody eachLike(@NotNull java.lang.String name)
Attribute that is an array where each item must match the following example
name - field name@NotNull public PactDslJsonBody eachLike(@NotNull java.lang.String name, @NotNull DslPart obj)
Array field where each element must match the following object
name - field name@NotNull public PactDslJsonBody eachLike()
Array element where each element of the array must match the following object
@NotNull public PactDslJsonArray eachLike(@NotNull DslPart obj)
Array element where each element of the array must match the provided object
@NotNull public PactDslJsonBody eachLike(@NotNull java.lang.String name, int numberExamples)
Attribute that is an array where each item must match the following example
name - field namenumberExamples - number of examples to generate@NotNull public PactDslJsonBody eachLike(int numberExamples)
Array element where each element of the array must match the following object
numberExamples - number of examples to generate@JvmOverloads @NotNull public PactDslJsonBody eachLike(@NotNull java.lang.String name, @NotNull PactDslJsonRootValue value, int numberExamples)
Attribute that is an array of values that are not objects where each item must match the following example
name - field namevalue - Value to use to match each itemnumberExamples - number of examples to generate@JvmOverloads @NotNull public PactDslJsonBody eachLike(@NotNull java.lang.String name, @NotNull PactDslJsonRootValue value)
Attribute that is an array of values that are not objects where each item must match the following example
name - field namevalue - Value to use to match each item@NotNull public PactDslJsonBody minArrayLike(@NotNull java.lang.String name, int size)
Attribute that is an array with a minimum size where each item must match the following example
name - field namesize - minimum size of the array@NotNull public PactDslJsonBody minArrayLike(int size)
Array element with a minimum size and each element of the array must match the following object
size - minimum size@NotNull public PactDslJsonBody minArrayLike(@NotNull java.lang.String name, int size, @NotNull DslPart obj)
Array field with a minimum size and each element must match the provided object
name - field namesize - minimum size@NotNull public PactDslJsonArray minArrayLike(int size, @NotNull DslPart obj)
Array element with a minumum size and each element of the array must match the provided object
size - minimum size@NotNull public PactDslJsonBody minArrayLike(@NotNull java.lang.String name, int size, int numberExamples)
Attribute that is an array with a minimum size where each item must match the following example
name - field namesize - minimum size of the arraynumberExamples - number of examples to generate@NotNull public PactDslJsonBody minArrayLike(int size, int numberExamples)
Array element with a minimum size and each element of the array must match the following object
size - minimum sizenumberExamples - number of examples to generate@JvmOverloads @NotNull public PactDslJsonBody minArrayLike(@NotNull java.lang.String name, int size, @NotNull PactDslJsonRootValue value, int numberExamples)
Attribute that is an array of values with a minimum size that are not objects where each item must match the following example
name - field namesize - minimum size of the arrayvalue - Value to use to match each itemnumberExamples - number of examples to generate@JvmOverloads @NotNull public PactDslJsonBody minArrayLike(@NotNull java.lang.String name, int size, @NotNull PactDslJsonRootValue value)
Attribute that is an array of values with a minimum size that are not objects where each item must match the following example
name - field namesize - minimum size of the arrayvalue - Value to use to match each item@NotNull public PactDslJsonBody maxArrayLike(@NotNull java.lang.String name, int size)
Attribute that is an array with a maximum size where each item must match the following example
name - field namesize - maximum size of the array@NotNull public PactDslJsonBody maxArrayLike(int size)
Array element with a maximum size and each element of the array must match the following object
size - maximum size@NotNull public PactDslJsonBody maxArrayLike(@NotNull java.lang.String name, int size, @NotNull DslPart obj)
Array field with a maximum size and each element must match the provided object
name - field namesize - maximum size@NotNull public PactDslJsonArray maxArrayLike(int size, @NotNull DslPart obj)
Array element with a maximum size and each element of the array must match the provided object
size - minimum size@NotNull public PactDslJsonBody maxArrayLike(@NotNull java.lang.String name, int size, int numberExamples)
Attribute that is an array with a maximum size where each item must match the following example
name - field namesize - maximum size of the arraynumberExamples - number of examples to generate@NotNull public PactDslJsonBody maxArrayLike(int size, int numberExamples)
Array element with a maximum size and each element of the array must match the following object
size - maximum sizenumberExamples - number of examples to generate@JvmOverloads @NotNull public PactDslJsonBody maxArrayLike(@NotNull java.lang.String name, int size, @NotNull PactDslJsonRootValue value, int numberExamples)
Attribute that is an array of values with a maximum size that are not objects where each item must match the following example
name - field namesize - maximum size of the arrayvalue - Value to use to match each itemnumberExamples - number of examples to generate@JvmOverloads @NotNull public PactDslJsonBody maxArrayLike(@NotNull java.lang.String name, int size, @NotNull PactDslJsonRootValue value)
Attribute that is an array of values with a maximum size that are not objects where each item must match the following example
name - field namesize - maximum size of the arrayvalue - Value to use to match each item@JvmOverloads @NotNull public PactDslJsonBody id(@NotNull java.lang.String name)
Attribute named 'id' that must be a numeric identifier
@JvmOverloads @NotNull public PactDslJsonBody id()
Attribute named 'id' that must be a numeric identifier
@NotNull public PactDslJsonBody id(@NotNull java.lang.String name, long id)
Attribute that must be a numeric identifier
name - attribute nameid - example id to use for generated bodies@NotNull public PactDslJsonBody hexValue(@NotNull java.lang.String name)
Attribute that must be encoded as a hexadecimal value
name - attribute name@NotNull public PactDslJsonBody hexValue(@NotNull java.lang.String name, @NotNull java.lang.String hexValue)
Attribute that must be encoded as a hexadecimal value
name - attribute namehexValue - example value to use for generated bodies@NotNull public PactDslJsonBody uuid(@NotNull java.lang.String name)
Attribute that must be encoded as an UUID
name - attribute name@NotNull public PactDslJsonBody uuid(@NotNull java.lang.String name, @NotNull java.util.UUID uuid)
Attribute that must be encoded as an UUID
name - attribute nameuuid - example UUID to use for generated bodies@NotNull public PactDslJsonBody uuid(@NotNull java.lang.String name, @NotNull java.lang.String uuid)
Attribute that must be encoded as an UUID
name - attribute nameuuid - example UUID to use for generated bodies@NotNull public PactDslJsonBody nullValue(@NotNull java.lang.String fieldName)
Sets the field to a null value
fieldName - field name@NotNull public PactDslJsonArray eachArrayLike(@NotNull java.lang.String name)
Array field where each element is an array and must match the following object
name - field name@NotNull public PactDslJsonArray eachArrayLike()
Array element where each element of the array is an array and must match the following object
@NotNull public PactDslJsonArray eachArrayLike(@NotNull java.lang.String name, int numberExamples)
Array field where each element is an array and must match the following object
name - field namenumberExamples - number of examples to generate@NotNull public PactDslJsonArray eachArrayLike(int numberExamples)
Array element where each element of the array is an array and must match the following object
numberExamples - number of examples to generate@NotNull public PactDslJsonArray eachArrayWithMaxLike(@NotNull java.lang.String name, int size)
Array field where each element is an array and must match the following object
name - field namesize - Maximum size of the outer array@NotNull public PactDslJsonArray eachArrayWithMaxLike(int size)
Array element where each element of the array is an array and must match the following object
size - Maximum size of the outer array@NotNull public PactDslJsonArray eachArrayWithMaxLike(@NotNull java.lang.String name, int numberExamples, int size)
Array field where each element is an array and must match the following object
name - field namenumberExamples - number of examples to generatesize - Maximum size of the outer array@NotNull public PactDslJsonArray eachArrayWithMaxLike(int numberExamples, int size)
Array element where each element of the array is an array and must match the following object
numberExamples - number of examples to generatesize - Maximum size of the outer array@NotNull public PactDslJsonArray eachArrayWithMinLike(@NotNull java.lang.String name, int size)
Array field where each element is an array and must match the following object
name - field namesize - Minimum size of the outer array@NotNull public PactDslJsonArray eachArrayWithMinLike(int size)
Array element where each element of the array is an array and must match the following object
size - Minimum size of the outer array@NotNull public PactDslJsonArray eachArrayWithMinLike(@NotNull java.lang.String name, int numberExamples, int size)
Array field where each element is an array and must match the following object
name - field namenumberExamples - number of examples to generatesize - Minimum size of the outer array@NotNull public PactDslJsonArray eachArrayWithMinLike(int numberExamples, int size)
Array element where each element of the array is an array and must match the following object
numberExamples - number of examples to generatesize - Minimum size of the outer array@NotNull public PactDslJsonBody eachKeyMappedToAnArrayLike(@NotNull java.lang.String exampleKey)
Accepts any key, and each key is mapped to a list of items that must match the following object definition Note: this needs the Java system property "pact.matching.wildcard" set to value "true" when the pact file is verified.
exampleKey - Example key to use for generating bodies@NotNull public PactDslJsonBody eachKeyLike(@NotNull java.lang.String exampleKey)
Accepts any key, and each key is mapped to a map that must match the following object definition Note: this needs the Java system property "pact.matching.wildcard" set to value "true" when the pact file is verified.
exampleKey - Example key to use for generating bodies@NotNull public PactDslJsonBody eachKeyLike(@NotNull java.lang.String exampleKey, @NotNull PactDslJsonRootValue value)
Accepts any key, and each key is mapped to a map that must match the provided object definition Note: this needs the Java system property "pact.matching.wildcard" set to value "true" when the pact file is verified.
exampleKey - Example key to use for generating bodiesvalue - Value to use for matching and generated bodies@NotNull public PactDslJsonBody includesStr(@NotNull java.lang.String name, @NotNull java.lang.String value)
Attribute that must include the provided string value
name - attribute namevalue - Value that must be included@NotNull public PactDslJsonBody equalTo(@NotNull java.lang.String name, @Nullable java.lang.Object value)
Attribute that must be equal to the provided value.
name - attribute namevalue - Value that will be used for comparisons@NotNull public PactDslJsonBody and(@NotNull java.lang.String name, @Nullable java.lang.Object value, @NotNull au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using AND
name - Attribute namevalue - Attribute example valuerules - Matching rules to apply@NotNull public PactDslJsonBody or(@NotNull java.lang.String name, @Nullable java.lang.Object value, @NotNull au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using OR
name - Attribute namevalue - Attribute example valuerules - Matching rules to apply@NotNull public PactDslJsonBody matchUrl(@NotNull java.lang.String name, @Nullable java.lang.String basePath, @NotNull java.lang.Object... pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions
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. These can be strings or regular expressions.@NotNull public DslPart matchUrl(@Nullable java.lang.String basePath, @NotNull java.lang.Object... pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions
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. These can be strings or regular expressions.@NotNull public PactDslJsonBody matchUrl2(@NotNull java.lang.String name, @NotNull java.lang.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.
name - Attribute namepathFragments - Series of path fragments to match on. These can be strings or regular expressions.@NotNull public DslPart matchUrl2(@NotNull java.lang.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.
pathFragments - Series of path fragments to match on. These can be strings or regular expressions.@NotNull public PactDslJsonBody minMaxArrayLike(@NotNull java.lang.String name, int minSize, int maxSize)
Array field with a minimum and maximum size and each element must match the following object
name - field nameminSize - minimum sizemaxSize - maximum size@NotNull public PactDslJsonBody minMaxArrayLike(@NotNull java.lang.String name, int minSize, int maxSize, @NotNull DslPart obj)
Array field with a minimum and maximum size and each element must match the provided object
name - field nameminSize - minimum sizemaxSize - maximum size@NotNull public PactDslJsonBody minMaxArrayLike(int minSize, int maxSize)
Array element with a minimum and maximum size and each element of the array must match the following object
minSize - minimum sizemaxSize - maximum size@NotNull public PactDslJsonArray minMaxArrayLike(int minSize, int maxSize, @NotNull DslPart obj)
Array element with a minimum and maximum size and each element of the array must match the provided object
minSize - minimum sizemaxSize - maximum size@NotNull public PactDslJsonBody minMaxArrayLike(@NotNull java.lang.String name, int minSize, int maxSize, int numberExamples)
Array field with a minimum and maximum size and each element must match the following object
name - field nameminSize - minimum sizemaxSize - maximum sizenumberExamples - number of examples to generate@NotNull public PactDslJsonBody minMaxArrayLike(int minSize, int maxSize, int numberExamples)
Array element with a minimum and maximum size and each element of the array must match the following object
minSize - minimum sizemaxSize - maximum sizenumberExamples - number of examples to generate@NotNull public PactDslJsonArray eachArrayWithMinMaxLike(@NotNull java.lang.String name, int minSize, int maxSize)
Array field where each element is an array and must match the following object
name - field nameminSize - minimum sizemaxSize - maximum size@NotNull public PactDslJsonArray eachArrayWithMinMaxLike(int minSize, int maxSize)
Array element where each element of the array is an array and must match the following object
minSize - minimum sizemaxSize - maximum size@NotNull public PactDslJsonArray eachArrayWithMinMaxLike(@NotNull java.lang.String name, int numberExamples, int minSize, int maxSize)
Array field where each element is an array and must match the following object
name - field namenumberExamples - number of examples to generateminSize - minimum sizemaxSize - maximum size@NotNull public PactDslJsonArray eachArrayWithMinMaxLike(int numberExamples, int minSize, int maxSize)
Array element where each element of the array is an array and must match the following object
numberExamples - number of examples to generateminSize - minimum sizemaxSize - maximum size@NotNull public PactDslJsonBody minMaxArrayLike(@NotNull java.lang.String name, int minSize, int maxSize, @NotNull PactDslJsonRootValue value, int numberExamples)
Attribute that is an array of values with a minimum and maximum size that are not objects where each item must match the following example
name - field nameminSize - minimum sizemaxSize - maximum sizevalue - Value to use to match each itemnumberExamples - number of examples to generate@NotNull public PactDslJsonBody valueFromProviderState(@NotNull java.lang.String name, @NotNull java.lang.String expression, @Nullable java.lang.Object example)
Adds an attribute that will have it's value injected from the provider state
name - Attribute nameexpression - Expression to be evaluated from the provider stateexample - Example value to be used in the consumer test@JvmOverloads @NotNull public PactDslJsonBody dateExpression(@NotNull java.lang.String name, @NotNull java.lang.String expression, @NotNull java.lang.String format)
Adds a date attribute with the value generated by the date expression
name - Attribute nameexpression - Date expression to use to generate the valuesformat - Date format to use@JvmOverloads @NotNull public PactDslJsonBody dateExpression(@NotNull java.lang.String name, @NotNull java.lang.String expression)
Adds a date attribute with the value generated by the date expression
name - Attribute nameexpression - Date expression to use to generate the values@JvmOverloads @NotNull public PactDslJsonBody timeExpression(@NotNull java.lang.String name, @NotNull java.lang.String expression, @NotNull java.lang.String format)
Adds a time attribute with the value generated by the time expression
name - Attribute nameexpression - Time expression to use to generate the valuesformat - Time format to use@JvmOverloads @NotNull public PactDslJsonBody timeExpression(@NotNull java.lang.String name, @NotNull java.lang.String expression)
Adds a time attribute with the value generated by the time expression
name - Attribute nameexpression - Time expression to use to generate the values@JvmOverloads @NotNull public PactDslJsonBody datetimeExpression(@NotNull java.lang.String name, @NotNull java.lang.String expression, @NotNull java.lang.String format)
Adds a datetime attribute with the value generated by the expression
name - Attribute nameexpression - Datetime expression to use to generate the valuesformat - Datetime format to use@JvmOverloads @NotNull public PactDslJsonBody datetimeExpression(@NotNull java.lang.String name, @NotNull java.lang.String expression)
Adds a datetime attribute with the value generated by the expression
name - Attribute nameexpression - Datetime expression to use to generate the values