-
public class PactDslJsonRootValue extends DslPart
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
PactDslJsonRootValue.Companion
-
Constructor Summary
Constructors Constructor Description PactDslJsonRootValue()
-
Method Summary
Modifier and Type Method Description Unit
putObjectPrivate(DslPart obj)
Unit
putArrayPrivate(DslPart obj)
PactDslJsonArray
array(String name)
Field which is an array PactDslJsonArray
array()
Element as an array DslPart
closeArray()
Close of the previous array element PactDslJsonBody
eachLike(String name)
Array field where each element must match the following object PactDslJsonBody
eachLike(String name, DslPart obj)
Array field where each element must match the following object PactDslJsonBody
eachLike(Integer numberExamples)
Array element where each element of the array must match the following object PactDslJsonBody
eachLike(String name, Integer numberExamples)
Array field where each element must match the following object PactDslJsonBody
eachLike()
Array element where each element of the array must match the following object PactDslJsonArray
eachLike(DslPart object)
Array element where each element of the array must match the provided object PactDslJsonBody
minArrayLike(String name, Integer size)
Array field with a minimum size and each element must match the following object PactDslJsonBody
minArrayLike(Integer size)
Array element with a minimum size and each element of the array must match the following object PactDslJsonBody
minArrayLike(String name, Integer size, DslPart obj)
Array field with a minimum size and each element must match the provided object PactDslJsonArray
minArrayLike(Integer size, DslPart obj)
Array element with a minumum size and each element of the array must match the provided object PactDslJsonBody
minArrayLike(String name, Integer size, Integer numberExamples)
Array field with a minumum size and each element must match the following object PactDslJsonBody
minArrayLike(Integer size, Integer numberExamples)
Array element with a minimum size and each element of the array must match the following object PactDslJsonBody
maxArrayLike(String name, Integer size)
Array field with a maximum size and each element must match the following object PactDslJsonBody
maxArrayLike(Integer size)
Array element with a maximum size and each element of the array must match the following object PactDslJsonBody
maxArrayLike(String name, Integer size, DslPart obj)
Array field with a maximum size and each element must match the provided object PactDslJsonArray
maxArrayLike(Integer size, DslPart obj)
Array element with a maximum size and each element of the array must match the provided object PactDslJsonBody
maxArrayLike(String name, Integer size, Integer numberExamples)
Array field with a maximum size and each element must match the following object PactDslJsonBody
maxArrayLike(Integer size, Integer numberExamples)
Array element with a maximum size and each element of the array must match the following object PactDslJsonBody
minMaxArrayLike(String name, Integer minSize, Integer maxSize)
Array field with a minimum and maximum size and each element must match the following object 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 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 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 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 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 PactDslJsonBody
object(String name)
Object field PactDslJsonBody
object()
Object element DslPart
closeObject()
Close off the previous object DslPart
close()
This closes off the object graph build from the DSL in case any closeObject|Array methods have not been called. final Unit
setMatcher(MatchingRule matcher)
PactDslJsonArray
eachArrayLike(String name)
Array field where each element is an array and must match the following object PactDslJsonArray
eachArrayLike(Integer numberExamples)
Array element where each element of the array is an array and must match the following object PactDslJsonArray
eachArrayLike(String name, Integer numberExamples)
Array field where each element is an array and must match the following object PactDslJsonArray
eachArrayLike()
Array element where each element of the array is an array and must match the following object PactDslJsonArray
eachArrayWithMaxLike(String name, Integer size)
Array field where each element is an array and must match the following object PactDslJsonArray
eachArrayWithMaxLike(Integer size)
Array element where each element of the array is an array and must match the following object PactDslJsonArray
eachArrayWithMaxLike(String name, Integer numberExamples, Integer size)
Array field where each element is an array and must match the following object PactDslJsonArray
eachArrayWithMaxLike(Integer numberExamples, Integer size)
Array element where each element of the array is an array and must match the following object PactDslJsonArray
eachArrayWithMinLike(String name, Integer size)
Array field where each element is an array and must match the following object PactDslJsonArray
eachArrayWithMinLike(Integer size)
Array element where each element of the array is an array and must match the following object PactDslJsonArray
eachArrayWithMinLike(String name, Integer numberExamples, Integer size)
Array field where each element is an array and must match the following object PactDslJsonArray
eachArrayWithMinLike(Integer numberExamples, Integer size)
Array element where each element of the array is an array and must match the following object PactDslJsonArray
eachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize)
Array field where each element is an array and must match the following object PactDslJsonArray
eachArrayWithMinMaxLike(Integer minSize, Integer maxSize)
Array element where each element of the array is an array and must match the following object PactDslJsonArray
eachArrayWithMinMaxLike(String name, Integer numberExamples, Integer minSize, Integer maxSize)
Array field where each element is an array and must match the following object 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 PactDslJsonArray
unorderedArray(String name)
Array field where order is ignored PactDslJsonArray
unorderedArray()
Array element where order is ignored PactDslJsonArray
unorderedMinArray(String name, Integer size)
Array field of min size where order is ignored PactDslJsonArray
unorderedMinArray(Integer size)
Array element of min size where order is ignored PactDslJsonArray
unorderedMaxArray(String name, Integer size)
Array field of max size where order is ignored PactDslJsonArray
unorderedMaxArray(Integer size)
Array element of max size where order is ignored PactDslJsonArray
unorderedMinMaxArray(String name, Integer minSize, Integer maxSize)
Array field of min and max size where order is ignored PactDslJsonArray
unorderedMinMaxArray(Integer minSize, Integer maxSize)
Array element of min and max size where order is ignored PactDslJsonRootValue
matchUrl(String basePath, Array<out Object> pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions DslPart
matchUrl(String name, String basePath, Array<out Object> pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions PactDslJsonBody
matchUrl2(String name, Array<out Object> pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions. DslPart
matchUrl2(Array<out Object> pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions. DslPart
arrayContaining(String name)
Matches the items in an array against a number of variants. final Object
getValue()
JsonValue
getBody()
final DslPart
getParent()
Returns the parent of this part (object or array) final String
getRootPath()
final String
getRootName()
final MatchingRuleCategory
getMatchers()
final Generators
getGenerators()
final Unit
setValue(Object value)
Unit
setBody(JsonValue body)
final Unit
setMatchers(MatchingRuleCategory matchers)
final Unit
setGenerators(Generators generators)
-
Methods inherited from class au.com.dius.pact.consumer.dsl.PactDslJsonRootValue
asArray, asBody
-
Methods inherited from class au.com.dius.pact.consumer.dsl.DslPart
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
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, Array<out 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, Array<out 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, Array<out 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(Array<out 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
-
getBody
JsonValue getBody()
-
getRootPath
final String getRootPath()
-
getRootName
final String getRootName()
-
getMatchers
final MatchingRuleCategory getMatchers()
-
getGenerators
final Generators getGenerators()
-
setMatchers
final Unit setMatchers(MatchingRuleCategory matchers)
-
setGenerators
final Unit setGenerators(Generators generators)
-
-
-
-