public class PactDslJsonRootValue extends DslPart
public static au.com.dius.pact.consumer.dsl.PactDslJsonRootValue.Companion Companion
@Nullable public java.lang.Object getValue()
public void setValue(@Nullable
java.lang.Object p)
public void putObjectPrivate(@NotNull
DslPart obj)
public void putArrayPrivate(@NotNull
DslPart obj)
@NotNull public au.com.dius.pact.core.support.json.JsonValue getBody()
public void setBody(@NotNull
au.com.dius.pact.core.support.json.JsonValue body)
@Deprecated @NotNull public PactDslJsonArray array(@NotNull java.lang.String name)
Field which is an array
name - field name@Deprecated @NotNull public PactDslJsonArray array()
Element as an array
@Deprecated @Nullable public DslPart closeArray()
Close of the previous array element
@Deprecated @NotNull public PactDslJsonBody eachLike(@NotNull java.lang.String name)
Array field where each element must match the following object
name - field name@Deprecated @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@Deprecated @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@Deprecated @NotNull public PactDslJsonBody eachLike(@NotNull java.lang.String name, int numberExamples)
Array field where each element must match the following object
name - field namenumberExamples - number of examples to generate@Deprecated @NotNull public PactDslJsonBody eachLike()
Array element where each element of the array must match the following object
@Deprecated @NotNull public PactDslJsonArray eachLike(@NotNull DslPart object)
Array element where each element of the array must match the provided object
@Deprecated @NotNull public PactDslJsonBody minArrayLike(@NotNull java.lang.String name, int size)
Array field with a minimum size and each element must match the following object
name - field namesize - minimum size@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @NotNull public PactDslJsonBody minArrayLike(@NotNull java.lang.String name, int size, int numberExamples)
Array field with a minumum size and each element must match the following object
name - field namesize - minimum sizenumberExamples - number of examples to generate@Deprecated @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@Deprecated @NotNull public PactDslJsonBody maxArrayLike(@NotNull java.lang.String name, int size)
Array field with a maximum size and each element must match the following object
name - field namesize - maximum size@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @NotNull public PactDslJsonBody maxArrayLike(@NotNull java.lang.String name, int size, int numberExamples)
Array field with a maximum size and each element must match the following object
name - field namesize - maximum sizenumberExamples - number of examples to generate@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @NotNull public PactDslJsonBody object(@NotNull java.lang.String name)
Object field
name - field name@Deprecated @NotNull public PactDslJsonBody object()
Object element
@Deprecated @Nullable public DslPart closeObject()
Close off the previous object
@NotNull public DslPart close()
This closes off the object graph build from the DSL in case any closeObject|Array methods have not been called.
public void setMatcher(@NotNull
au.com.dius.pact.core.model.matchingrules.MatchingRule matcher)
@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @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@Deprecated @NotNull public PactDslJsonArray eachArrayLike()
Array element where each element of the array is an array and must match the following object
@NotNull public PactDslJsonRootValue 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 DslPart 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 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.@JvmStatic @NotNull public static PactDslJsonRootValue stringType()
Value that can be any string
@JvmStatic @NotNull public static PactDslJsonRootValue stringType(@NotNull java.lang.String example)
Value that can be any string
example - example value to use for generated bodies@JvmStatic @NotNull public static PactDslJsonRootValue numberType()
Value that can be any number
@JvmStatic @NotNull public static PactDslJsonRootValue numberType(@NotNull java.lang.Number number)
Value that can be any number
number - example number to use for generated bodies@JvmStatic @NotNull public static PactDslJsonRootValue integerType()
Value that must be an integer
@JvmStatic @NotNull public static PactDslJsonRootValue integerType(long number)
Value that must be an integer
number - example integer value to use for generated bodies@JvmStatic @NotNull public static PactDslJsonRootValue integerType(int number)
Value that must be an integer
number - example integer value to use for generated bodies@JvmStatic @NotNull public static PactDslJsonRootValue decimalType()
Value that must be a decimal value
@JvmStatic @NotNull public static PactDslJsonRootValue decimalType(@NotNull java.math.BigDecimal number)
Value that must be a decimalType value
number - example decimalType value@JvmStatic @NotNull public static PactDslJsonRootValue decimalType(double number)
Value that must be a decimalType value
number - example decimalType value@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue booleanType(boolean example)
Value that must be a boolean
example - example boolean to use for generated bodies@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue booleanType()
Value that must be a boolean
@JvmStatic @NotNull public static PactDslJsonRootValue stringMatcher(@NotNull java.lang.String regex, @NotNull java.lang.String value)
Value that must match the regular expression
regex - regular expressionvalue - example value to use for generated bodies@Deprecated @JvmStatic @NotNull public static PactDslJsonRootValue stringMatcher(@NotNull java.lang.String regex)
Value that must match the regular expression
regex - regular expression@JvmOverloads @Deprecated @JvmStatic @NotNull public static PactDslJsonRootValue timestamp(@NotNull java.lang.String format)
Value that must match the given timestamp format
format - timestamp format@JvmOverloads @Deprecated @JvmStatic @NotNull public static PactDslJsonRootValue timestamp()
Value that must match the given timestamp format
@Deprecated @JvmStatic @NotNull public static PactDslJsonRootValue timestamp(@NotNull java.lang.String format, @NotNull java.util.Date example)
Value that must match the given timestamp format
format - timestamp formatexample - example date and time to use for generated bodies@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue datetime(@NotNull java.lang.String format)
Value that must match the given timestamp format
format - timestamp format@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue datetime()
Value that must match the given timestamp format
@JvmStatic @NotNull public static PactDslJsonRootValue datetime(@NotNull java.lang.String format, @NotNull java.util.Date example)
Value that must match the given timestamp format
format - timestamp formatexample - example date and time to use for generated bodies@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue date(@NotNull java.lang.String format)
Value that must match the provided date format
format - date format to match@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue date()
Value that must match the provided date format
@JvmStatic @NotNull public static PactDslJsonRootValue date(@NotNull java.lang.String format, @NotNull java.util.Date example)
Value that must match the provided date format
format - date format to matchexample - example date to use for generated values@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue time(@NotNull java.lang.String format)
Value that must match the given time format
format - time format to match@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue time()
Value that must match the given time format
@JvmStatic @NotNull public static PactDslJsonRootValue time(@NotNull java.lang.String format, @NotNull java.util.Date example)
Value that must match the given time format
format - time format to matchexample - example time to use for generated bodies@JvmStatic @NotNull public static PactDslJsonRootValue ipAddress()
Value that must be an IP4 address
@JvmStatic @NotNull public static PactDslJsonRootValue id()
Value that must be a numeric identifier
@JvmStatic @NotNull public static PactDslJsonRootValue id(long id)
Value that must be a numeric identifier
id - example id to use for generated bodies@JvmStatic @NotNull public static PactDslJsonRootValue hexValue()
Value that must be encoded as a hexadecimal value
@JvmStatic @NotNull public static PactDslJsonRootValue hexValue(@NotNull java.lang.String hexValue)
Value that must be encoded as a hexadecimal value
hexValue - example value to use for generated bodies@JvmStatic @NotNull public static PactDslJsonRootValue uuid()
Value that must be encoded as an UUID
@JvmStatic @NotNull public static PactDslJsonRootValue uuid(@NotNull java.util.UUID uuid)
Value that must be encoded as an UUID
uuid - example UUID to use for generated bodies@JvmStatic @NotNull public static PactDslJsonRootValue uuid(@NotNull java.lang.String uuid)
Value that must be encoded as an UUID
uuid - example UUID to use for generated bodies@JvmStatic @NotNull public static PactDslJsonRootValue and(@Nullable java.lang.Object example, @NotNull au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using AND
example - Attribute example valuerules - Matching rules to apply@JvmStatic @NotNull public static PactDslJsonRootValue or(@Nullable java.lang.Object example, @NotNull au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using OR
example - Attribute namerules - Matching rules to apply@JvmStatic @NotNull public static PactDslJsonRootValue valueFromProviderState(@NotNull java.lang.String expression, @Nullable java.lang.Object example)
Adds a value that will have it's value injected from the provider state
expression - Expression to be evaluated from the provider stateexample - Example value to be used in the consumer test@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue dateExpression(@NotNull java.lang.String expression, @NotNull java.lang.String format)
Date value generated from an expression.
expression - Date expressionformat - Date format to use@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue dateExpression(@NotNull java.lang.String expression)
Date value generated from an expression.
expression - Date expression@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue timeExpression(@NotNull java.lang.String expression, @NotNull java.lang.String format)
Time value generated from an expression.
expression - Time expressionformat - Time format to use@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue timeExpression(@NotNull java.lang.String expression)
Time value generated from an expression.
expression - Time expression@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue datetimeExpression(@NotNull java.lang.String expression, @NotNull java.lang.String format)
Datetime value generated from an expression.
expression - Datetime expressionformat - Datetime format to use@JvmOverloads @JvmStatic @NotNull public static PactDslJsonRootValue datetimeExpression(@NotNull java.lang.String expression)
Datetime value generated from an expression.
expression - Datetime expression