public class PactDslJsonRootValue extends DslPart
closed, DATE_2000, generators, HEXADECIMAL, IP_ADDRESS, matchers, parent, rootName, rootPath, UUID_REGEX| Constructor and Description |
|---|
PactDslJsonRootValue() |
| Modifier and Type | Method and Description |
|---|---|
static PactDslJsonRootValue |
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 PactDslJsonRootValue |
booleanType()
Value that must be a boolean
|
static PactDslJsonRootValue |
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 PactDslJsonRootValue |
date()
Value that must be formatted as an ISO date
|
static PactDslJsonRootValue |
date(java.lang.String format)
Value that must match the provided date format
|
static PactDslJsonRootValue |
date(java.lang.String format,
java.util.Date example)
Value that must match the provided date format
|
static PactDslJsonRootValue |
dateExpression(java.lang.String expression)
Date value generated from an expression.
|
static PactDslJsonRootValue |
dateExpression(java.lang.String expression,
java.lang.String format)
Date value generated from an expression.
|
static PactDslJsonRootValue |
datetimeExpression(java.lang.String expression)
Datetime value generated from an expression.
|
static PactDslJsonRootValue |
datetimeExpression(java.lang.String expression,
java.lang.String format)
Datetime value generated from an expression.
|
static PactDslJsonRootValue |
decimalType()
Value that must be a decimal value
|
static PactDslJsonRootValue |
decimalType(java.math.BigDecimal number)
Value that must be a decimalType value
|
static PactDslJsonRootValue |
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)
Deprecated.
|
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)
Deprecated.
|
PactDslJsonBody |
eachLike(java.lang.String name,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
java.lang.Object |
getBody() |
static PactDslJsonRootValue |
hexValue()
Value that must be encoded as a hexadecimal value
|
static PactDslJsonRootValue |
hexValue(java.lang.String hexValue)
Value that must be encoded as a hexadecimal value
|
static PactDslJsonRootValue |
id()
Value that must be a numeric identifier
|
static PactDslJsonRootValue |
id(java.lang.Long id)
Value that must be a numeric identifier
|
static PactDslJsonRootValue |
integerType()
Value that must be an integer
|
static PactDslJsonRootValue |
integerType(java.lang.Integer number)
Value that must be an integer
|
static PactDslJsonRootValue |
integerType(java.lang.Long number)
Value that must be an integer
|
static PactDslJsonRootValue |
ipAddress()
Value that must be an IP4 address
|
boolean |
isEncodeJson()
If the value should be encoded to be safe as JSON
|
PactDslJsonRootValue |
matchUrl(java.lang.String basePath,
java.lang.Object... pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions
|
PactDslJsonBody |
maxArrayLike(java.lang.Integer size)
Deprecated.
Use PactDslJsonArray for arrays
|
PactDslJsonArray |
maxArrayLike(java.lang.Integer size,
DslPart object)
Deprecated.
|
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)
Deprecated.
|
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)
Deprecated.
|
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)
Deprecated.
|
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)
Deprecated.
|
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)
Deprecated.
|
PactDslJsonBody |
minMaxArrayLike(java.lang.String name,
java.lang.Integer minSize,
java.lang.Integer maxSize,
int numberExamples)
Deprecated.
Use PactDslJsonArray for arrays
|
static PactDslJsonRootValue |
numberType()
Value that can be any number
|
static PactDslJsonRootValue |
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 PactDslJsonRootValue |
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 |
setEncodeJson(boolean encodeJson)
If the value should be encoded to be safe as JSON
|
void |
setMatcher(au.com.dius.pact.core.model.matchingrules.MatchingRule matcher) |
void |
setValue(java.lang.Object value) |
static PactDslJsonRootValue |
stringMatcher(java.lang.String regex)
Deprecated.
Use the version that takes an example value
|
static PactDslJsonRootValue |
stringMatcher(java.lang.String regex,
java.lang.String value)
Value that must match the regular expression
|
static PactDslJsonRootValue |
stringType()
Value that can be any string
|
static PactDslJsonRootValue |
stringType(java.lang.String example)
Value that can be any string
|
static PactDslJsonRootValue |
time()
Value that must be an ISO formatted time
|
static PactDslJsonRootValue |
time(java.lang.String format)
Value that must match the given time format
|
static PactDslJsonRootValue |
time(java.lang.String format,
java.util.Date example)
Value that must match the given time format
|
static PactDslJsonRootValue |
timeExpression(java.lang.String expression)
Time value generated from an expression.
|
static PactDslJsonRootValue |
timeExpression(java.lang.String expression,
java.lang.String format)
Time value generated from an expression.
|
static PactDslJsonRootValue |
timestamp()
Value that must be an ISO formatted timestamp
|
static PactDslJsonRootValue |
timestamp(java.lang.String format)
Value that must match the given timestamp format
|
static PactDslJsonRootValue |
timestamp(java.lang.String format,
java.util.Date example)
Value that must match the given timestamp format
|
static PactDslJsonRootValue |
uuid()
Value that must be encoded as an UUID
|
static PactDslJsonRootValue |
uuid(java.lang.String uuid)
Value that must be encoded as an UUID
|
static PactDslJsonRootValue |
uuid(java.util.UUID uuid)
Value that must be encoded as an UUID
|
static PactDslJsonRootValue |
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 boolean isEncodeJson()
public void setEncodeJson(boolean encodeJson)
@Deprecated public PactDslJsonArray array(java.lang.String name)
DslPart@Deprecated public PactDslJsonArray array()
DslPart@Deprecated public DslPart closeArray()
DslPartcloseArray in class DslPart@Deprecated public PactDslJsonBody eachLike(java.lang.String name)
DslPart@Deprecated public PactDslJsonBody eachLike(java.lang.String name, DslPart object)
DslPart@Deprecated public PactDslJsonBody eachLike(int numberExamples)
DslPart@Deprecated public PactDslJsonBody eachLike(java.lang.String name, int numberExamples)
DslPart@Deprecated public PactDslJsonBody eachLike()
DslPart@Deprecated public PactDslJsonArray eachLike(DslPart object)
DslPart@Deprecated public PactDslJsonBody minArrayLike(java.lang.String name, java.lang.Integer size)
DslPartminArrayLike in class DslPartname - field namesize - minimum size@Deprecated public PactDslJsonBody minArrayLike(java.lang.Integer size)
DslPartminArrayLike in class DslPartsize - minimum size@Deprecated public PactDslJsonBody minArrayLike(java.lang.String name, java.lang.Integer size, DslPart object)
DslPartminArrayLike in class DslPartname - field namesize - minimum size@Deprecated public PactDslJsonArray minArrayLike(java.lang.Integer size, DslPart object)
DslPartminArrayLike in class DslPartsize - minimum size@Deprecated public PactDslJsonBody minArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples)
DslPartminArrayLike in class DslPartname - field namesize - minimum sizenumberExamples - number of examples to generate@Deprecated public PactDslJsonBody minArrayLike(java.lang.Integer size, int numberExamples)
DslPartminArrayLike in class DslPartsize - minimum sizenumberExamples - number of examples to generate@Deprecated public PactDslJsonBody maxArrayLike(java.lang.String name, java.lang.Integer size)
DslPartmaxArrayLike in class DslPartname - field namesize - maximum size@Deprecated public PactDslJsonBody maxArrayLike(java.lang.Integer size)
DslPartmaxArrayLike in class DslPartsize - minimum size@Deprecated public PactDslJsonBody maxArrayLike(java.lang.String name, java.lang.Integer size, DslPart object)
DslPartmaxArrayLike in class DslPartname - field namesize - maximum size@Deprecated public PactDslJsonArray maxArrayLike(java.lang.Integer size, DslPart object)
DslPartmaxArrayLike in class DslPartsize - minimum size@Deprecated public PactDslJsonBody maxArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples)
DslPartmaxArrayLike in class DslPartname - field namesize - maximum sizenumberExamples - number of examples to generate@Deprecated public PactDslJsonBody maxArrayLike(java.lang.Integer size, int numberExamples)
DslPartmaxArrayLike in class DslPartsize - minimum sizenumberExamples - number of examples to generate@Deprecated public PactDslJsonBody minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize)
DslPartminMaxArrayLike in class DslPartname - field nameminSize - minimum sizemaxSize - maximum size@Deprecated public 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 size@Deprecated public PactDslJsonBody minMaxArrayLike(java.lang.Integer minSize, java.lang.Integer maxSize)
DslPartminMaxArrayLike in class DslPartminSize - minimum sizemaxSize - maximum size@Deprecated public PactDslJsonArray minMaxArrayLike(java.lang.Integer minSize, java.lang.Integer maxSize, DslPart object)
DslPartminMaxArrayLike in class DslPartminSize - minimum sizemaxSize - maximum size@Deprecated public 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 generate@Deprecated public PactDslJsonBody minMaxArrayLike(java.lang.Integer minSize, java.lang.Integer maxSize, int numberExamples)
DslPartminMaxArrayLike in class DslPartminSize - minimum sizemaxSize - maximum sizenumberExamples - number of examples to generate@Deprecated public PactDslJsonBody object(java.lang.String name)
DslPart@Deprecated public PactDslJsonBody object()
DslPart@Deprecated public DslPart closeObject()
DslPartcloseObject in class DslPartpublic DslPart close()
DslPartpublic static PactDslJsonRootValue stringType()
public static PactDslJsonRootValue stringType(java.lang.String example)
example - example value to use for generated bodiespublic static PactDslJsonRootValue numberType()
public static PactDslJsonRootValue numberType(java.lang.Number number)
number - example number to use for generated bodiespublic static PactDslJsonRootValue integerType()
public static PactDslJsonRootValue integerType(java.lang.Long number)
number - example integer value to use for generated bodiespublic static PactDslJsonRootValue integerType(java.lang.Integer number)
number - example integer value to use for generated bodiespublic static PactDslJsonRootValue decimalType()
public static PactDslJsonRootValue decimalType(java.math.BigDecimal number)
number - example decimalType valuepublic static PactDslJsonRootValue decimalType(java.lang.Double number)
number - example decimalType valuepublic static PactDslJsonRootValue booleanType()
public static PactDslJsonRootValue booleanType(java.lang.Boolean example)
example - example boolean to use for generated bodiespublic static PactDslJsonRootValue stringMatcher(java.lang.String regex, java.lang.String value)
regex - regular expressionvalue - example value to use for generated bodies@Deprecated public static PactDslJsonRootValue stringMatcher(java.lang.String regex)
regex - regular expressionpublic static PactDslJsonRootValue timestamp()
public static PactDslJsonRootValue timestamp(java.lang.String format)
format - timestamp formatpublic static PactDslJsonRootValue timestamp(java.lang.String format, java.util.Date example)
format - timestamp formatexample - example date and time to use for generated bodiespublic static PactDslJsonRootValue date()
public static PactDslJsonRootValue date(java.lang.String format)
format - date format to matchpublic static PactDslJsonRootValue date(java.lang.String format, java.util.Date example)
format - date format to matchexample - example date to use for generated valuespublic static PactDslJsonRootValue time()
public static PactDslJsonRootValue time(java.lang.String format)
format - time format to matchpublic static PactDslJsonRootValue time(java.lang.String format, java.util.Date example)
format - time format to matchexample - example time to use for generated bodiespublic static PactDslJsonRootValue ipAddress()
public static PactDslJsonRootValue id()
public static PactDslJsonRootValue id(java.lang.Long id)
id - example id to use for generated bodiespublic static PactDslJsonRootValue hexValue()
public static PactDslJsonRootValue hexValue(java.lang.String hexValue)
hexValue - example value to use for generated bodiespublic static PactDslJsonRootValue uuid()
public static PactDslJsonRootValue uuid(java.util.UUID uuid)
uuid - example UUID to use for generated bodiespublic static PactDslJsonRootValue 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)
@Deprecated public PactDslJsonArray eachArrayLike(java.lang.String name)
DslParteachArrayLike in class DslPartname - field name@Deprecated public PactDslJsonArray eachArrayLike(int numberExamples)
DslParteachArrayLike in class DslPartnumberExamples - number of examples to generate@Deprecated public PactDslJsonArray eachArrayWithMaxLike(java.lang.String name, java.lang.Integer size)
DslParteachArrayWithMaxLike in class DslPartname - field namesize - Maximum size of the outer array@Deprecated public PactDslJsonArray eachArrayWithMaxLike(java.lang.Integer size)
DslParteachArrayWithMaxLike in class DslPartsize - Maximum size of the outer array@Deprecated public 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 array@Deprecated public PactDslJsonArray eachArrayWithMaxLike(int numberExamples, java.lang.Integer size)
DslParteachArrayWithMaxLike in class DslPartnumberExamples - number of examples to generatesize - Maximum size of the outer array@Deprecated public PactDslJsonArray eachArrayWithMinLike(java.lang.String name, java.lang.Integer size)
DslParteachArrayWithMinLike in class DslPartname - field namesize - Minimum size of the outer array@Deprecated public PactDslJsonArray eachArrayWithMinLike(java.lang.Integer size)
DslParteachArrayWithMinLike in class DslPartsize - Minimum size of the outer array@Deprecated public 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 array@Deprecated public PactDslJsonArray eachArrayWithMinLike(int numberExamples, java.lang.Integer size)
DslParteachArrayWithMinLike in class DslPartnumberExamples - number of examples to generatesize - Minimum size of the outer array@Deprecated public PactDslJsonArray eachArrayWithMinMaxLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize)
DslParteachArrayWithMinMaxLike in class DslPartname - field nameminSize - minimum sizemaxSize - maximum size@Deprecated public PactDslJsonArray eachArrayWithMinMaxLike(java.lang.Integer minSize, java.lang.Integer maxSize)
DslParteachArrayWithMinMaxLike in class DslPartminSize - minimum sizemaxSize - maximum size@Deprecated public 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 size@Deprecated public PactDslJsonArray eachArrayWithMinMaxLike(int numberExamples, java.lang.Integer minSize, java.lang.Integer maxSize)
DslParteachArrayWithMinMaxLike in class DslPartnumberExamples - number of examples to generateminSize - minimum sizemaxSize - maximum size@Deprecated public PactDslJsonArray eachArrayLike(java.lang.String name, int numberExamples)
DslParteachArrayLike in class DslPartname - field namenumberExamples - number of examples to generate@Deprecated public PactDslJsonArray eachArrayLike()
DslParteachArrayLike in class DslPartpublic static PactDslJsonRootValue and(java.lang.Object example, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
example - Attribute example valuerules - Matching rules to applypublic static PactDslJsonRootValue or(java.lang.Object example, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
example - Attribute namerules - Matching rules to applypublic PactDslJsonRootValue matchUrl(java.lang.String basePath, java.lang.Object... pathFragments)
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.public static PactDslJsonRootValue 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 testpublic static PactDslJsonRootValue dateExpression(java.lang.String expression)
expression - Date expressionpublic static PactDslJsonRootValue dateExpression(java.lang.String expression, java.lang.String format)
expression - Date expressionformat - Date format to usepublic static PactDslJsonRootValue timeExpression(java.lang.String expression)
expression - Date expressionpublic static PactDslJsonRootValue timeExpression(java.lang.String expression, java.lang.String format)
expression - Time expressionformat - Time format to usepublic static PactDslJsonRootValue datetimeExpression(java.lang.String expression)
expression - Datetime expressionpublic static PactDslJsonRootValue datetimeExpression(java.lang.String expression, java.lang.String format)
expression - Datetime expressionformat - Datetime format to use