Class PactDslJsonRootValue
-
- All Implemented Interfaces:
public class PactDslJsonRootValue extends DslPart
-
-
Constructor Summary
Constructors Constructor Description PactDslJsonRootValue()
-
Method Summary
Modifier and Type Method Description final ObjectgetValue()final UnitsetValue(Object value)JsonValuegetBody()UnitsetBody(JsonValue body)UnitputObjectPrivate(DslPart obj)UnitputArrayPrivate(DslPart obj)PactDslJsonArrayarray(String name)Field which is an array PactDslJsonArrayarray()Element as an array DslPartcloseArray()Close of the previous array element PactDslJsonBodyeachLike(String name)Array field where each element must match the following object PactDslJsonBodyeachLike(String name, DslPart obj)Array field where each element must match the following object PactDslJsonBodyeachLike(Integer numberExamples)Array element where each element of the array must match the following object PactDslJsonBodyeachLike(String name, Integer numberExamples)Array field where each element must match the following object PactDslJsonBodyeachLike()Array element where each element of the array must match the following object PactDslJsonArrayeachLike(DslPart object)Array element where each element of the array must match the provided object PactDslJsonBodyminArrayLike(String name, Integer size)Array field with a minimum size and each element must match the following object PactDslJsonBodyminArrayLike(Integer size)Array element with a minimum size and each element of the array must match the following object PactDslJsonBodyminArrayLike(String name, Integer size, DslPart obj)Array field with a minimum size and each element must match the provided object PactDslJsonArrayminArrayLike(Integer size, DslPart obj)Array element with a minumum size and each element of the array must match the provided object PactDslJsonBodyminArrayLike(String name, Integer size, Integer numberExamples)Array field with a minumum size and each element must match the following object PactDslJsonBodyminArrayLike(Integer size, Integer numberExamples)Array element with a minimum size and each element of the array must match the following object PactDslJsonBodymaxArrayLike(String name, Integer size)Array field with a maximum size and each element must match the following object PactDslJsonBodymaxArrayLike(Integer size)Array element with a maximum size and each element of the array must match the following object PactDslJsonBodymaxArrayLike(String name, Integer size, DslPart obj)Array field with a maximum size and each element must match the provided object PactDslJsonArraymaxArrayLike(Integer size, DslPart obj)Array element with a maximum size and each element of the array must match the provided object PactDslJsonBodymaxArrayLike(String name, Integer size, Integer numberExamples)Array field with a maximum size and each element must match the following object PactDslJsonBodymaxArrayLike(Integer size, Integer numberExamples)Array element with a maximum size and each element of the array must match the following object PactDslJsonBodyminMaxArrayLike(String name, Integer minSize, Integer maxSize)Array field with a minimum and maximum size and each element must match the following object PactDslJsonBodyminMaxArrayLike(String name, Integer minSize, Integer maxSize, DslPart obj)Array field with a minimum and maximum size and each element must match the provided object PactDslJsonBodyminMaxArrayLike(Integer minSize, Integer maxSize)Array element with a minimum and maximum size and each element of the array must match the following object PactDslJsonArrayminMaxArrayLike(Integer minSize, Integer maxSize, DslPart obj)Array element with a minimum and maximum size and each element of the array must match the provided object PactDslJsonBodyminMaxArrayLike(String name, Integer minSize, Integer maxSize, Integer numberExamples)Array field with a minimum and maximum size and each element must match the following object PactDslJsonBodyminMaxArrayLike(Integer minSize, Integer maxSize, Integer numberExamples)Array element with a minimum and maximum size and each element of the array must match the following object PactDslJsonBodyobject(String name)Object field PactDslJsonBodyobject()Object element DslPartcloseObject()Close off the previous object DslPartclose()This closes off the object graph build from the DSL in case any closeObject|Array methods have not been called. final UnitsetMatcher(MatchingRule matcher)PactDslJsonArrayeachArrayLike(String name)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayLike(Integer numberExamples)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayLike(String name, Integer numberExamples)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayLike()Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMaxLike(String name, Integer size)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMaxLike(Integer size)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMaxLike(String name, Integer numberExamples, Integer size)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMaxLike(Integer numberExamples, Integer size)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMinLike(String name, Integer size)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMinLike(Integer size)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMinLike(String name, Integer numberExamples, Integer size)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMinLike(Integer numberExamples, Integer size)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMinMaxLike(Integer minSize, Integer maxSize)Array element where each element of the array is an array and must match the following object PactDslJsonArrayeachArrayWithMinMaxLike(String name, Integer numberExamples, Integer minSize, Integer maxSize)Array field where each element is an array and must match the following object PactDslJsonArrayeachArrayWithMinMaxLike(Integer numberExamples, Integer minSize, Integer maxSize)Array element where each element of the array is an array and must match the following object PactDslJsonArrayunorderedArray(String name)Array field where order is ignored PactDslJsonArrayunorderedArray()Array element where order is ignored PactDslJsonArrayunorderedMinArray(String name, Integer size)Array field of min size where order is ignored PactDslJsonArrayunorderedMinArray(Integer size)Array element of min size where order is ignored PactDslJsonArrayunorderedMaxArray(String name, Integer size)Array field of max size where order is ignored PactDslJsonArrayunorderedMaxArray(Integer size)Array element of max size where order is ignored PactDslJsonArrayunorderedMinMaxArray(String name, Integer minSize, Integer maxSize)Array field of min and max size where order is ignored PactDslJsonArrayunorderedMinMaxArray(Integer minSize, Integer maxSize)Array element of min and max size where order is ignored PactDslJsonRootValuematchUrl(String basePath, Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions DslPartmatchUrl(String name, String basePath, Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions PactDslJsonBodymatchUrl2(String name, Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions. DslPartmatchUrl2(Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions. DslPartarrayContaining(String name)Matches the items in an array against a number of variants. StringtoString()final static PactDslJsonRootValuestringType()Value that can be any string final static PactDslJsonRootValuestringType(String example)Value that can be any string final static PactDslJsonRootValuenumberType()Value that can be any number final static PactDslJsonRootValuenumberType(Number number)Value that can be any number final static PactDslJsonRootValueintegerType()Value that must be an integer final static PactDslJsonRootValueintegerType(Long number)Value that must be an integer final static PactDslJsonRootValueintegerType(Integer number)Value that must be an integer final static PactDslJsonRootValuedecimalType()Value that must be a decimal value (has significant digits after the decimal point) final static PactDslJsonRootValuedecimalType(BigDecimal number)Value that must be a decimalType value (has significant digits after the decimal point) final static PactDslJsonRootValuedecimalType(Double number)Value that must be a decimalType value (has significant digits after the decimal point) final static PactDslJsonRootValuenumberMatching(String regex, Number example)Attribute that can be any number and which must match the provided regular expression final static PactDslJsonRootValuedecimalMatching(String regex, Double example)Attribute that can be any number decimal number (has significant digits after the decimal point) and which must match the provided regular expression final static PactDslJsonRootValueintegerMatching(String regex, Integer example)Attribute that can be any integer and which must match the provided regular expression final static PactDslJsonRootValuebooleanType(Boolean example)Value that must be a boolean final static PactDslJsonRootValuebooleanType()Value that must be a boolean final static PactDslJsonRootValuestringMatcher(String regex, String value)Value that must match the regular expression final static PactDslJsonRootValuestringMatcher(String regex)Value that must match the regular expression final static PactDslJsonRootValuetimestamp(String format)Value that must match the given timestamp format final static PactDslJsonRootValuetimestamp()Value that must match the given timestamp format final static PactDslJsonRootValuetimestamp(String format, Date example)Value that must match the given timestamp format final static PactDslJsonRootValuedatetime(String format)Value that must match the given timestamp format final static PactDslJsonRootValuedatetime()Value that must match the given timestamp format final static PactDslJsonRootValuedatetime(String format, Date example)Value that must match the given timestamp format final static PactDslJsonRootValuedate(String format)Value that must match the provided date format final static PactDslJsonRootValuedate()Value that must match the provided date format final static PactDslJsonRootValuedate(String format, Date example)Value that must match the provided date format final static PactDslJsonRootValuetime(String format)Value that must match the given time format final static PactDslJsonRootValuetime()Value that must match the given time format final static PactDslJsonRootValuetime(String format, Date example)Value that must match the given time format final static PactDslJsonRootValueipAddress()Value that must be an IP4 address final static PactDslJsonRootValueid()Value that must be a numeric identifier final static PactDslJsonRootValueid(Long id)Value that must be a numeric identifier final static PactDslJsonRootValuehexValue()Value that must be encoded as a hexadecimal value final static PactDslJsonRootValuehexValue(String hexValue)Value that must be encoded as a hexadecimal value final static PactDslJsonRootValueuuid()Value that must be encoded as an UUID final static PactDslJsonRootValueuuid(UUID uuid)Value that must be encoded as an UUID final static PactDslJsonRootValueuuid(String uuid)Value that must be encoded as an UUID final static PactDslJsonRootValueand(Object example, MatchingRule rules)Combine all the matchers using AND final static PactDslJsonRootValueor(Object example, MatchingRule rules)Combine all the matchers using OR final static PactDslJsonRootValuevalueFromProviderState(String expression, Object example)Adds a value that will have it's value injected from the provider state final static PactDslJsonRootValuedateExpression(String expression, String format)Date value generated from an expression. final static PactDslJsonRootValuedateExpression(String expression)Date value generated from an expression. final static PactDslJsonRootValuetimeExpression(String expression, String format)Time value generated from an expression. final static PactDslJsonRootValuetimeExpression(String expression)Time value generated from an expression. final static PactDslJsonRootValuedatetimeExpression(String expression, String format)Datetime value generated from an expression. final static PactDslJsonRootValuedatetimeExpression(String expression)Datetime value generated from an expression. -
Methods inherited from class au.com.dius.pact.consumer.dsl.DslPart
asArray, asBody, getGenerators, getMatchers, getParent, getRootName, getRootPath, setGenerators, setMatchers -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getBody
JsonValue getBody()
-
putObjectPrivate
Unit putObjectPrivate(DslPart obj)
-
putArrayPrivate
Unit putArrayPrivate(DslPart obj)
-
array
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray array(String name)
Field which is an array
- Parameters:
name- field name
-
array
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray array()
Element as an array
-
closeArray
@Deprecated(message = "Use PactDslJsonArray for arrays") DslPart closeArray()
Close of the previous array element
-
eachLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody eachLike(String name)
Array field where each element must match the following object
- Parameters:
name- field name
-
eachLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody eachLike(String name, DslPart obj)
Array field where each element must match the following object
- Parameters:
name- field name
-
eachLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody eachLike(Integer numberExamples)
Array element where each element of the array must match the following object
- Parameters:
numberExamples- number of examples to generate
-
eachLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody eachLike(String name, Integer numberExamples)
Array field where each element must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generate
-
eachLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody eachLike()
Array element where each element of the array must match the following object
-
eachLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachLike(DslPart object)
Array element where each element of the array must match the provided object
-
minArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minArrayLike(String name, Integer size)
Array field with a minimum size and each element must match the following object
- Parameters:
name- field namesize- minimum size
-
minArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minArrayLike(Integer size)
Array element with a minimum size and each element of the array must match the following object
- Parameters:
size- minimum size
-
minArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minArrayLike(String name, Integer size, DslPart obj)
Array field with a minimum size and each element must match the provided object
- Parameters:
name- field namesize- minimum size
-
minArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray minArrayLike(Integer size, DslPart obj)
Array element with a minumum size and each element of the array must match the provided object
- Parameters:
size- minimum size
-
minArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minArrayLike(String name, Integer size, Integer numberExamples)
Array field with a minumum size and each element must match the following object
- Parameters:
name- field namesize- minimum sizenumberExamples- number of examples to generate
-
minArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minArrayLike(Integer size, Integer numberExamples)
Array element with a minimum size and each element of the array must match the following object
- Parameters:
size- minimum sizenumberExamples- number of examples to generate
-
maxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody maxArrayLike(String name, Integer size)
Array field with a maximum size and each element must match the following object
- Parameters:
name- field namesize- maximum size
-
maxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody maxArrayLike(Integer size)
Array element with a maximum size and each element of the array must match the following object
- Parameters:
size- maximum size
-
maxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody maxArrayLike(String name, Integer size, DslPart obj)
Array field with a maximum size and each element must match the provided object
- Parameters:
name- field namesize- maximum size
-
maxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray maxArrayLike(Integer size, DslPart obj)
Array element with a maximum size and each element of the array must match the provided object
- Parameters:
size- minimum size
-
maxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody maxArrayLike(String name, Integer size, Integer numberExamples)
Array field with a maximum size and each element must match the following object
- Parameters:
name- field namesize- maximum sizenumberExamples- number of examples to generate
-
maxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody maxArrayLike(Integer size, Integer numberExamples)
Array element with a maximum size and each element of the array must match the following object
- Parameters:
size- maximum sizenumberExamples- number of examples to generate
-
minMaxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minMaxArrayLike(String name, Integer minSize, Integer maxSize)
Array field with a minimum and maximum size and each element must match the following object
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
minMaxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minMaxArrayLike(String name, Integer minSize, Integer maxSize, DslPart obj)
Array field with a minimum and maximum size and each element must match the provided object
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
minMaxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minMaxArrayLike(Integer minSize, Integer maxSize)
Array element with a minimum and maximum size and each element of the array must match the following object
- Parameters:
minSize- minimum sizemaxSize- maximum size
-
minMaxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray minMaxArrayLike(Integer minSize, Integer maxSize, DslPart obj)
Array element with a minimum and maximum size and each element of the array must match the provided object
- Parameters:
minSize- minimum sizemaxSize- maximum size
-
minMaxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minMaxArrayLike(String name, Integer minSize, Integer maxSize, Integer numberExamples)
Array field with a minimum and maximum size and each element must match the following object
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum sizenumberExamples- number of examples to generate
-
minMaxArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonBody minMaxArrayLike(Integer minSize, Integer maxSize, Integer numberExamples)
Array element with a minimum and maximum size and each element of the array must match the following object
- Parameters:
minSize- minimum sizemaxSize- maximum sizenumberExamples- number of examples to generate
-
object
@Deprecated(message = "Use PactDslJsonBody for objects") PactDslJsonBody object(String name)
Object field
- Parameters:
name- field name
-
object
@Deprecated(message = "Use PactDslJsonBody for objects") PactDslJsonBody object()
Object element
-
closeObject
@Deprecated(message = "Use PactDslJsonBody for objects") DslPart closeObject()
Close off the previous object
-
close
DslPart close()
This closes off the object graph build from the DSL in case any closeObject|Array methods have not been called.
-
setMatcher
final Unit setMatcher(MatchingRule matcher)
-
eachArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayLike(String name)
Array field where each element is an array and must match the following object
- Parameters:
name- field name
-
eachArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayLike(Integer numberExamples)
Array element where each element of the array is an array and must match the following object
- Parameters:
numberExamples- number of examples to generate
-
eachArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayLike(String name, Integer numberExamples)
Array field where each element is an array and must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generate
-
eachArrayLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayLike()
Array element where each element of the array is an array and must match the following object
-
eachArrayWithMaxLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMaxLike(String name, Integer size)
Array field where each element is an array and must match the following object
- Parameters:
name- field namesize- Maximum size of the outer array
-
eachArrayWithMaxLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMaxLike(Integer size)
Array element where each element of the array is an array and must match the following object
- Parameters:
size- Maximum size of the outer array
-
eachArrayWithMaxLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMaxLike(String name, Integer numberExamples, Integer size)
Array field where each element is an array and must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generatesize- Maximum size of the outer array
-
eachArrayWithMaxLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMaxLike(Integer numberExamples, Integer size)
Array element where each element of the array is an array and must match the following object
- Parameters:
numberExamples- number of examples to generatesize- Maximum size of the outer array
-
eachArrayWithMinLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMinLike(String name, Integer size)
Array field where each element is an array and must match the following object
- Parameters:
name- field namesize- Minimum size of the outer array
-
eachArrayWithMinLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMinLike(Integer size)
Array element where each element of the array is an array and must match the following object
- Parameters:
size- Minimum size of the outer array
-
eachArrayWithMinLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMinLike(String name, Integer numberExamples, Integer size)
Array field where each element is an array and must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generatesize- Minimum size of the outer array
-
eachArrayWithMinLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMinLike(Integer numberExamples, Integer size)
Array element where each element of the array is an array and must match the following object
- Parameters:
numberExamples- number of examples to generatesize- Minimum size of the outer array
-
eachArrayWithMinMaxLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize)
Array field where each element is an array and must match the following object
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
eachArrayWithMinMaxLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMinMaxLike(Integer minSize, Integer maxSize)
Array element where each element of the array is an array and must match the following object
- Parameters:
minSize- minimum sizemaxSize- maximum size
-
eachArrayWithMinMaxLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMinMaxLike(String name, Integer numberExamples, Integer minSize, Integer maxSize)
Array field where each element is an array and must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generateminSize- minimum sizemaxSize- maximum size
-
eachArrayWithMinMaxLike
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray eachArrayWithMinMaxLike(Integer numberExamples, Integer minSize, Integer maxSize)
Array element where each element of the array is an array and must match the following object
- Parameters:
numberExamples- number of examples to generateminSize- minimum sizemaxSize- maximum size
-
unorderedArray
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray unorderedArray(String name)
Array field where order is ignored
- Parameters:
name- field name
-
unorderedArray
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray unorderedArray()
Array element where order is ignored
-
unorderedMinArray
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray unorderedMinArray(String name, Integer size)
Array field of min size where order is ignored
- Parameters:
name- field namesize- minimum size
-
unorderedMinArray
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray unorderedMinArray(Integer size)
Array element of min size where order is ignored
- Parameters:
size- minimum size
-
unorderedMaxArray
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray unorderedMaxArray(String name, Integer size)
Array field of max size where order is ignored
- Parameters:
name- field namesize- maximum size
-
unorderedMaxArray
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray unorderedMaxArray(Integer size)
Array element of max size where order is ignored
- Parameters:
size- maximum size
-
unorderedMinMaxArray
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray unorderedMinMaxArray(String name, Integer minSize, Integer maxSize)
Array field of min and max size where order is ignored
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
unorderedMinMaxArray
@Deprecated(message = "Use PactDslJsonArray for arrays") PactDslJsonArray unorderedMinMaxArray(Integer minSize, Integer maxSize)
Array element of min and max size where order is ignored
- Parameters:
minSize- minimum sizemaxSize- maximum size
-
matchUrl
PactDslJsonRootValue matchUrl(String basePath, Object pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions
- Parameters:
basePath- The base path for the URL (like "http://localhost:8080/") which will be excluded from the matchingpathFragments- Series of path fragments to match on.
-
matchUrl
DslPart matchUrl(String name, String basePath, Object pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions
- Parameters:
name- Attribute namebasePath- The base path for the URL (like "http://localhost:8080/") which will be excluded from the matchingpathFragments- Series of path fragments to match on.
-
matchUrl2
PactDslJsonBody matchUrl2(String name, Object pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions. Base path from the mock server will be used.
- Parameters:
name- Attribute namepathFragments- Series of path fragments to match on.
-
matchUrl2
DslPart matchUrl2(Object pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions. Base path from the mock server will be used.
- Parameters:
pathFragments- Series of path fragments to match on.
-
arrayContaining
DslPart arrayContaining(String name)
Matches the items in an array against a number of variants. Matching is successful if each variant occurs once in the array. Variants may be objects containing matching rules.
- Parameters:
name- Attribute name
-
stringType
final static PactDslJsonRootValue stringType()
Value that can be any string
-
stringType
final static PactDslJsonRootValue stringType(String example)
Value that can be any string
- Parameters:
example- example value to use for generated bodies
-
numberType
final static PactDslJsonRootValue numberType()
Value that can be any number
-
numberType
final static PactDslJsonRootValue numberType(Number number)
Value that can be any number
- Parameters:
number- example number to use for generated bodies
-
integerType
final static PactDslJsonRootValue integerType()
Value that must be an integer
-
integerType
final static PactDslJsonRootValue integerType(Long number)
Value that must be an integer
- Parameters:
number- example integer value to use for generated bodies
-
integerType
final static PactDslJsonRootValue integerType(Integer number)
Value that must be an integer
- Parameters:
number- example integer value to use for generated bodies
-
decimalType
final static PactDslJsonRootValue decimalType()
Value that must be a decimal value (has significant digits after the decimal point)
-
decimalType
final static PactDslJsonRootValue decimalType(BigDecimal number)
Value that must be a decimalType value (has significant digits after the decimal point)
- Parameters:
number- example decimalType value
-
decimalType
final static PactDslJsonRootValue decimalType(Double number)
Value that must be a decimalType value (has significant digits after the decimal point)
- Parameters:
number- example decimalType value
-
numberMatching
final static PactDslJsonRootValue numberMatching(String regex, Number example)
Attribute that can be any number and which must match the provided regular expression
- Parameters:
regex- Regular expression that the numbers string form must matchexample- example number to use for generated bodies
-
decimalMatching
final static PactDslJsonRootValue decimalMatching(String regex, Double example)
Attribute that can be any number decimal number (has significant digits after the decimal point) and which must match the provided regular expression
- Parameters:
regex- Regular expression that the numbers string form must matchexample- example number to use for generated bodies
-
integerMatching
final static PactDslJsonRootValue integerMatching(String regex, Integer example)
Attribute that can be any integer and which must match the provided regular expression
- Parameters:
regex- Regular expression that the numbers string form must matchexample- example integer to use for generated bodies
-
booleanType
@JvmOverloads() final static PactDslJsonRootValue booleanType(Boolean example)
Value that must be a boolean
- Parameters:
example- example boolean to use for generated bodies
-
booleanType
@JvmOverloads() final static PactDslJsonRootValue booleanType()
Value that must be a boolean
-
stringMatcher
final static PactDslJsonRootValue stringMatcher(String regex, String value)
Value that must match the regular expression
- Parameters:
regex- regular expressionvalue- example value to use for generated bodies
-
stringMatcher
@Deprecated(message = "Use the version that takes an example value") final static PactDslJsonRootValue stringMatcher(String regex)
Value that must match the regular expression
- Parameters:
regex- regular expression
-
timestamp
@JvmOverloads()@Deprecated(message = "use datetime") final static PactDslJsonRootValue timestamp(String format)
Value that must match the given timestamp format
- Parameters:
format- timestamp format
-
timestamp
@JvmOverloads()@Deprecated(message = "use datetime") final static PactDslJsonRootValue timestamp()
Value that must match the given timestamp format
-
timestamp
@Deprecated(message = "use datetime") final static PactDslJsonRootValue timestamp(String format, Date example)
Value that must match the given timestamp format
- Parameters:
format- timestamp formatexample- example date and time to use for generated bodies
-
datetime
@JvmOverloads() final static PactDslJsonRootValue datetime(String format)
Value that must match the given timestamp format
- Parameters:
format- timestamp format
-
datetime
@JvmOverloads() final static PactDslJsonRootValue datetime()
Value that must match the given timestamp format
-
datetime
final static PactDslJsonRootValue datetime(String format, Date example)
Value that must match the given timestamp format
- Parameters:
format- timestamp formatexample- example date and time to use for generated bodies
-
date
@JvmOverloads() final static PactDslJsonRootValue date(String format)
Value that must match the provided date format
- Parameters:
format- date format to match
-
date
@JvmOverloads() final static PactDslJsonRootValue date()
Value that must match the provided date format
-
date
final static PactDslJsonRootValue date(String format, Date example)
Value that must match the provided date format
- Parameters:
format- date format to matchexample- example date to use for generated values
-
time
@JvmOverloads() final static PactDslJsonRootValue time(String format)
Value that must match the given time format
- Parameters:
format- time format to match
-
time
@JvmOverloads() final static PactDslJsonRootValue time()
Value that must match the given time format
-
time
final static PactDslJsonRootValue time(String format, Date example)
Value that must match the given time format
- Parameters:
format- time format to matchexample- example time to use for generated bodies
-
ipAddress
final static PactDslJsonRootValue ipAddress()
Value that must be an IP4 address
-
id
final static PactDslJsonRootValue id()
Value that must be a numeric identifier
-
id
final static PactDslJsonRootValue id(Long id)
Value that must be a numeric identifier
- Parameters:
id- example id to use for generated bodies
-
hexValue
final static PactDslJsonRootValue hexValue()
Value that must be encoded as a hexadecimal value
-
hexValue
final static PactDslJsonRootValue hexValue(String hexValue)
Value that must be encoded as a hexadecimal value
- Parameters:
hexValue- example value to use for generated bodies
-
uuid
final static PactDslJsonRootValue uuid()
Value that must be encoded as an UUID
-
uuid
final static PactDslJsonRootValue uuid(UUID uuid)
Value that must be encoded as an UUID
- Parameters:
uuid- example UUID to use for generated bodies
-
uuid
final static PactDslJsonRootValue uuid(String uuid)
Value that must be encoded as an UUID
- Parameters:
uuid- example UUID to use for generated bodies
-
and
final static PactDslJsonRootValue and(Object example, MatchingRule rules)
Combine all the matchers using AND
- Parameters:
example- Attribute example valuerules- Matching rules to apply
-
or
final static PactDslJsonRootValue or(Object example, MatchingRule rules)
Combine all the matchers using OR
- Parameters:
example- Attribute namerules- Matching rules to apply
-
valueFromProviderState
final static PactDslJsonRootValue valueFromProviderState(String expression, Object example)
Adds a value that will have it's value injected from the provider state
- Parameters:
expression- Expression to be evaluated from the provider stateexample- Example value to be used in the consumer test
-
dateExpression
@JvmOverloads() final static PactDslJsonRootValue dateExpression(String expression, String format)
Date value generated from an expression.
- Parameters:
expression- Date expressionformat- Date format to use
-
dateExpression
@JvmOverloads() final static PactDslJsonRootValue dateExpression(String expression)
Date value generated from an expression.
- Parameters:
expression- Date expression
-
timeExpression
@JvmOverloads() final static PactDslJsonRootValue timeExpression(String expression, String format)
Time value generated from an expression.
- Parameters:
expression- Time expressionformat- Time format to use
-
timeExpression
@JvmOverloads() final static PactDslJsonRootValue timeExpression(String expression)
Time value generated from an expression.
- Parameters:
expression- Time expression
-
datetimeExpression
@JvmOverloads() final static PactDslJsonRootValue datetimeExpression(String expression, String format)
Datetime value generated from an expression.
- Parameters:
expression- Datetime expressionformat- Datetime format to use
-
datetimeExpression
@JvmOverloads() final static PactDslJsonRootValue datetimeExpression(String expression)
Datetime value generated from an expression.
- Parameters:
expression- Datetime expression
-
-
-
-