public class PactDslRootValue extends DslPart
closed, DATE_2000, generators, HEXADECIMAL, IP_ADDRESS, matchers, parent, rootName, rootPath, UUID_REGEX| Constructor and Description |
|---|
PactDslRootValue() |
| Modifier and Type | Method and Description |
|---|---|
static PactDslRootValue |
and(java.lang.Object example,
au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using AND
|
PactDslJsonArray |
array()
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
array(java.lang.String name)
Deprecated.
Use PactDslJsonArray for arrays
|
static PactDslRootValue |
booleanType()
Value that must be a boolean
|
static PactDslRootValue |
booleanType(java.lang.Boolean example)
Value that must be a boolean
|
DslPart |
close()
This closes off the object graph build from the DSL in case any close[Object|Array] methods have not been called.
|
DslPart |
closeArray()
Deprecated.
Use PactDslJsonArray for arrays
|
DslPart |
closeObject()
Deprecated.
Use PactDslJsonBody for objects
|
static PactDslRootValue |
date()
Value that must be formatted as an ISO date
|
static PactDslRootValue |
date(java.lang.String format)
Value that must match the provided date format
|
static PactDslRootValue |
date(java.lang.String format,
java.util.Date example)
Value that must match the provided date format
|
static PactDslRootValue |
decimalType()
Value that must be a decimal value
|
static PactDslRootValue |
decimalType(java.math.BigDecimal number)
Value that must be a decimalType value
|
static PactDslRootValue |
decimalType(java.lang.Double number)
Value that must be a decimalType value
|
PactDslJsonArray |
eachArrayLike()
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayLike(int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayLike(java.lang.String name)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayLike(java.lang.String name,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMaxLike(java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMaxLike(int numberExamples,
java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMaxLike(java.lang.String name,
java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMaxLike(java.lang.String name,
int numberExamples,
java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMinLike(java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMinLike(int numberExamples,
java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMinLike(java.lang.String name,
java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMinLike(java.lang.String name,
int numberExamples,
java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMinMaxLike(java.lang.Integer minSize,
java.lang.Integer maxSize)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMinMaxLike(int numberExamples,
java.lang.Integer minSize,
java.lang.Integer maxSize)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMinMaxLike(java.lang.String name,
java.lang.Integer minSize,
java.lang.Integer maxSize)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachArrayWithMinMaxLike(java.lang.String name,
int numberExamples,
java.lang.Integer minSize,
java.lang.Integer maxSize)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
eachLike()
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
eachLike(DslPart object)
Array element where each element of the array must match the provided object
|
PactDslJsonBody |
eachLike(int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
eachLike(java.lang.String name)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
eachLike(java.lang.String name,
DslPart object)
Array field where each element must match the following object
|
PactDslJsonBody |
eachLike(java.lang.String name,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
java.lang.Object |
getBody() |
static PactDslRootValue |
hexValue()
Value that must be encoded as a hexadecimal value
|
static PactDslRootValue |
hexValue(java.lang.String hexValue)
Value that must be encoded as a hexadecimal value
|
static PactDslRootValue |
id()
Value that must be a numeric identifier
|
static PactDslRootValue |
id(java.lang.Long id)
Value that must be a numeric identifier
|
static PactDslRootValue |
integerType()
Value that must be an integer
|
static PactDslRootValue |
integerType(java.lang.Integer number)
Value that must be an integer
|
static PactDslRootValue |
integerType(java.lang.Long number)
Value that must be an integer
|
static PactDslRootValue |
ipAddress()
Value that must be an IP4 address
|
PactDslJsonBody |
maxArrayLike(java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
maxArrayLike(java.lang.Integer size,
DslPart object)
Array element with a maximum size and each element of the array must match the provided object
|
PactDslJsonBody |
maxArrayLike(java.lang.Integer size,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
maxArrayLike(java.lang.String name,
java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
maxArrayLike(java.lang.String name,
java.lang.Integer size,
DslPart object)
Array field with a maximum size and each element must match the provided object
|
PactDslJsonBody |
maxArrayLike(java.lang.String name,
java.lang.Integer size,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
minArrayLike(java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
minArrayLike(java.lang.Integer size,
DslPart object)
Array element with a minumum size and each element of the array must match the provided object
|
PactDslJsonBody |
minArrayLike(java.lang.Integer size,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
minArrayLike(java.lang.String name,
java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
minArrayLike(java.lang.String name,
java.lang.Integer size,
DslPart object)
Array field with a minumum size and each element must match the provided object
|
PactDslJsonBody |
minArrayLike(java.lang.String name,
java.lang.Integer size,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
minMaxArrayLike(java.lang.Integer minSize,
java.lang.Integer maxSize)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
minMaxArrayLike(java.lang.Integer minSize,
java.lang.Integer maxSize,
DslPart object)
Array element with a minimum and maximum size and each element of the array must match the provided object
|
PactDslJsonBody |
minMaxArrayLike(java.lang.Integer minSize,
java.lang.Integer maxSize,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
minMaxArrayLike(java.lang.String name,
java.lang.Integer minSize,
java.lang.Integer maxSize)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonBody |
minMaxArrayLike(java.lang.String name,
java.lang.Integer minSize,
java.lang.Integer maxSize,
DslPart object)
Array field with a minimum and maximum size and each element must match the provided object
|
PactDslJsonBody |
minMaxArrayLike(java.lang.String name,
java.lang.Integer minSize,
java.lang.Integer maxSize,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
static PactDslRootValue |
numberType()
Value that can be any number
|
static PactDslRootValue |
numberType(java.lang.Number number)
Value that can be any number
|
PactDslJsonBody |
object()
Deprecated.
Use PactDslJsonBody for objects
|
PactDslJsonBody |
object(java.lang.String name)
Deprecated.
Use PactDslJsonBody for objects
|
static PactDslRootValue |
or(java.lang.Object example,
au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using OR
|
protected void |
putArray(DslPart object) |
protected void |
putObject(DslPart object) |
void |
setMatcher(au.com.dius.pact.core.model.matchingrules.MatchingRule matcher) |
void |
setValue(java.lang.Object value) |
static PactDslRootValue |
stringMatcher(java.lang.String regex,
java.lang.String value)
Value that must match the regular expression
|
static PactDslRootValue |
stringType()
Value that can be any string
|
static PactDslRootValue |
stringType(java.lang.String example)
Value that can be any string
|
static PactDslRootValue |
time()
Value that must be an ISO formatted time
|
static PactDslRootValue |
time(java.lang.String format)
Value that must match the given time format
|
static PactDslRootValue |
time(java.lang.String format,
java.util.Date example)
Value that must match the given time format
|
static PactDslRootValue |
timestamp()
Value that must be an ISO formatted timestamp
|
static PactDslRootValue |
timestamp(java.lang.String format)
Value that must match the given timestamp format
|
static PactDslRootValue |
timestamp(java.lang.String format,
java.util.Date example)
Value that must match the given timestamp format
|
static PactDslRootValue |
uuid()
Value that must be encoded as an UUID
|
static PactDslRootValue |
uuid(java.lang.String uuid)
Value that must be encoded as an UUID
|
static PactDslRootValue |
uuid(java.util.UUID uuid)
Value that must be encoded as an UUID
|
static PactDslRootValue |
valueFromProviderState(java.lang.String expression,
java.lang.Object example)
Adds a value that will have it's value injected from the provider state
|
asArray, asBody, getGenerators, getMatchers, getParent, includesMatcher, matchDate, matchMax, matchMin, matchMinMax, matchTime, matchTimestamp, regexp, setGenerators, setMatcherspublic PactDslJsonArray array(java.lang.String name)
DslPartpublic PactDslJsonArray array()
DslPartpublic DslPart closeArray()
DslPartcloseArray in class DslPartpublic PactDslJsonBody eachLike(java.lang.String name)
DslPartpublic PactDslJsonBody eachLike(java.lang.String name, DslPart object)
DslPartpublic PactDslJsonBody eachLike(int numberExamples)
DslPartpublic PactDslJsonBody eachLike(java.lang.String name, int numberExamples)
DslPartpublic PactDslJsonBody eachLike()
DslPartpublic PactDslJsonArray eachLike(DslPart object)
DslPartpublic PactDslJsonBody minArrayLike(java.lang.String name, java.lang.Integer size)
DslPartminArrayLike in class DslPartname - field namesize - minimum sizepublic PactDslJsonBody minArrayLike(java.lang.Integer size)
DslPartminArrayLike in class DslPartsize - minimum sizepublic PactDslJsonBody minArrayLike(java.lang.String name, java.lang.Integer size, DslPart object)
DslPartminArrayLike in class DslPartname - field namesize - minimum sizepublic PactDslJsonArray minArrayLike(java.lang.Integer size, DslPart object)
DslPartminArrayLike in class DslPartsize - minimum sizepublic PactDslJsonBody minArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples)
DslPartminArrayLike in class DslPartname - field namesize - minimum sizenumberExamples - number of examples to generatepublic PactDslJsonBody minArrayLike(java.lang.Integer size, int numberExamples)
DslPartminArrayLike in class DslPartsize - minimum sizenumberExamples - number of examples to generatepublic PactDslJsonBody maxArrayLike(java.lang.String name, java.lang.Integer size)
DslPartmaxArrayLike in class DslPartname - field namesize - maximum sizepublic PactDslJsonBody maxArrayLike(java.lang.Integer size)
DslPartmaxArrayLike in class DslPartsize - minimum sizepublic PactDslJsonBody maxArrayLike(java.lang.String name, java.lang.Integer size, DslPart object)
DslPartmaxArrayLike in class DslPartname - field namesize - maximum sizepublic PactDslJsonArray maxArrayLike(java.lang.Integer size, DslPart object)
DslPartmaxArrayLike in class DslPartsize - minimum sizepublic PactDslJsonBody maxArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples)
DslPartmaxArrayLike in class DslPartname - field namesize - maximum sizenumberExamples - number of examples to generatepublic PactDslJsonBody maxArrayLike(java.lang.Integer size, int numberExamples)
DslPartmaxArrayLike in class DslPartsize - minimum sizenumberExamples - number of examples to generatepublic PactDslJsonBody minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize)
DslPartminMaxArrayLike in class DslPartname - field nameminSize - minimum sizemaxSize - maximum sizepublic PactDslJsonBody minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, DslPart object)
DslPartminMaxArrayLike in class DslPartname - field nameminSize - minimum sizemaxSize - maximum sizepublic PactDslJsonBody minMaxArrayLike(java.lang.Integer minSize, java.lang.Integer maxSize)
DslPartminMaxArrayLike in class DslPartminSize - minimum sizemaxSize - maximum sizepublic PactDslJsonArray minMaxArrayLike(java.lang.Integer minSize, java.lang.Integer maxSize, DslPart object)
DslPartminMaxArrayLike in class DslPartminSize - minimum sizemaxSize - maximum sizepublic PactDslJsonBody minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, int numberExamples)
DslPartminMaxArrayLike in class DslPartname - field nameminSize - minimum sizemaxSize - maximum sizenumberExamples - number of examples to generatepublic PactDslJsonBody minMaxArrayLike(java.lang.Integer minSize, java.lang.Integer maxSize, int numberExamples)
DslPartminMaxArrayLike in class DslPartminSize - minimum sizemaxSize - maximum sizenumberExamples - number of examples to generatepublic PactDslJsonBody object(java.lang.String name)
DslPartpublic PactDslJsonBody object()
DslPartpublic DslPart closeObject()
DslPartcloseObject in class DslPartpublic DslPart close()
DslPartpublic static PactDslRootValue stringType()
public static PactDslRootValue stringType(java.lang.String example)
example - example value to use for generated bodiespublic static PactDslRootValue numberType()
public static PactDslRootValue numberType(java.lang.Number number)
number - example number to use for generated bodiespublic static PactDslRootValue integerType()
public static PactDslRootValue integerType(java.lang.Long number)
number - example integer value to use for generated bodiespublic static PactDslRootValue integerType(java.lang.Integer number)
number - example integer value to use for generated bodiespublic static PactDslRootValue decimalType()
public static PactDslRootValue decimalType(java.math.BigDecimal number)
number - example decimalType valuepublic static PactDslRootValue decimalType(java.lang.Double number)
number - example decimalType valuepublic static PactDslRootValue booleanType()
public static PactDslRootValue booleanType(java.lang.Boolean example)
example - example boolean to use for generated bodiespublic static PactDslRootValue stringMatcher(java.lang.String regex, java.lang.String value)
regex - regular expressionvalue - example value to use for generated bodiespublic static PactDslRootValue timestamp()
public static PactDslRootValue timestamp(java.lang.String format)
format - timestamp formatpublic static PactDslRootValue timestamp(java.lang.String format, java.util.Date example)
format - timestamp formatexample - example date and time to use for generated bodiespublic static PactDslRootValue date()
public static PactDslRootValue date(java.lang.String format)
format - date format to matchpublic static PactDslRootValue date(java.lang.String format, java.util.Date example)
format - date format to matchexample - example date to use for generated valuespublic static PactDslRootValue time()
public static PactDslRootValue time(java.lang.String format)
format - time format to matchpublic static PactDslRootValue time(java.lang.String format, java.util.Date example)
format - time format to matchexample - example time to use for generated bodiespublic static PactDslRootValue ipAddress()
public static PactDslRootValue id()
public static PactDslRootValue id(java.lang.Long id)
id - example id to use for generated bodiespublic static PactDslRootValue hexValue()
public static PactDslRootValue hexValue(java.lang.String hexValue)
hexValue - example value to use for generated bodiespublic static PactDslRootValue uuid()
public static PactDslRootValue uuid(java.util.UUID uuid)
uuid - example UUID to use for generated bodiespublic static PactDslRootValue uuid(java.lang.String uuid)
uuid - example UUID to use for generated bodiespublic void setValue(java.lang.Object value)
public void setMatcher(au.com.dius.pact.core.model.matchingrules.MatchingRule matcher)
public PactDslJsonArray eachArrayLike(java.lang.String name)
DslParteachArrayLike in class DslPartname - field namepublic PactDslJsonArray eachArrayLike(int numberExamples)
DslParteachArrayLike in class DslPartnumberExamples - number of examples to generatepublic PactDslJsonArray eachArrayWithMaxLike(java.lang.String name, java.lang.Integer size)
DslParteachArrayWithMaxLike in class DslPartname - field namesize - Maximum size of the outer arraypublic PactDslJsonArray eachArrayWithMaxLike(java.lang.Integer size)
DslParteachArrayWithMaxLike in class DslPartsize - Maximum size of the outer arraypublic PactDslJsonArray eachArrayWithMaxLike(java.lang.String name, int numberExamples, java.lang.Integer size)
DslParteachArrayWithMaxLike in class DslPartname - field namenumberExamples - number of examples to generatesize - Maximum size of the outer arraypublic PactDslJsonArray eachArrayWithMaxLike(int numberExamples, java.lang.Integer size)
DslParteachArrayWithMaxLike in class DslPartnumberExamples - number of examples to generatesize - Maximum size of the outer arraypublic PactDslJsonArray eachArrayWithMinLike(java.lang.String name, java.lang.Integer size)
DslParteachArrayWithMinLike in class DslPartname - field namesize - Minimum size of the outer arraypublic PactDslJsonArray eachArrayWithMinLike(java.lang.Integer size)
DslParteachArrayWithMinLike in class DslPartsize - Minimum size of the outer arraypublic PactDslJsonArray eachArrayWithMinLike(java.lang.String name, int numberExamples, java.lang.Integer size)
DslParteachArrayWithMinLike in class DslPartname - field namenumberExamples - number of examples to generatesize - Minimum size of the outer arraypublic PactDslJsonArray eachArrayWithMinLike(int numberExamples, java.lang.Integer size)
DslParteachArrayWithMinLike in class DslPartnumberExamples - number of examples to generatesize - Minimum size of the outer arraypublic PactDslJsonArray eachArrayWithMinMaxLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize)
DslParteachArrayWithMinMaxLike in class DslPartname - field nameminSize - minimum sizemaxSize - maximum sizepublic PactDslJsonArray eachArrayWithMinMaxLike(java.lang.Integer minSize, java.lang.Integer maxSize)
DslParteachArrayWithMinMaxLike in class DslPartminSize - minimum sizemaxSize - maximum sizepublic PactDslJsonArray eachArrayWithMinMaxLike(java.lang.String name, int numberExamples, java.lang.Integer minSize, java.lang.Integer maxSize)
DslParteachArrayWithMinMaxLike in class DslPartname - field namenumberExamples - number of examples to generateminSize - minimum sizemaxSize - maximum sizepublic PactDslJsonArray eachArrayWithMinMaxLike(int numberExamples, java.lang.Integer minSize, java.lang.Integer maxSize)
DslParteachArrayWithMinMaxLike in class DslPartnumberExamples - number of examples to generateminSize - minimum sizemaxSize - maximum sizepublic PactDslJsonArray eachArrayLike(java.lang.String name, int numberExamples)
DslParteachArrayLike in class DslPartname - field namenumberExamples - number of examples to generatepublic PactDslJsonArray eachArrayLike()
DslParteachArrayLike in class DslPartpublic static PactDslRootValue and(java.lang.Object example, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
example - Attribute example valuerules - Matching rules to applypublic static PactDslRootValue or(java.lang.Object example, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
example - Attribute namerules - Matching rules to applypublic static PactDslRootValue valueFromProviderState(java.lang.String expression, java.lang.Object example)
expression - Expression to be evaluated from the provider stateexample - Example value to be used in the consumer test