-
public abstract class DslPartAbstract base class to support Object and Array JSON DSL builders
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDslPart.Companion
-
Method Summary
Modifier and Type Method Description final DslPartgetParent()Returns the parent of this part (object or array) final StringgetRootPath()final StringgetRootName()final MatchingRuleCategorygetMatchers()final UnitsetMatchers(MatchingRuleCategory matchers)final GeneratorsgetGenerators()final UnitsetGenerators(Generators generators)abstract JsonValuegetBody()abstract UnitsetBody(JsonValue body)abstract UnitputObjectPrivate(DslPart obj)abstract UnitputArrayPrivate(DslPart obj)abstract PactDslJsonArrayarray(String name)Field which is an array abstract PactDslJsonArrayarray()Element as an array abstract PactDslJsonArrayunorderedArray(String name)Array field where order is ignored abstract PactDslJsonArrayunorderedArray()Array element where order is ignored abstract PactDslJsonArrayunorderedMinArray(String name, Integer size)Array field of min size where order is ignored abstract PactDslJsonArrayunorderedMinArray(Integer size)Array element of min size where order is ignored abstract PactDslJsonArrayunorderedMaxArray(String name, Integer size)Array field of max size where order is ignored abstract PactDslJsonArrayunorderedMaxArray(Integer size)Array element of max size where order is ignored abstract PactDslJsonArrayunorderedMinMaxArray(String name, Integer minSize, Integer maxSize)Array field of min and max size where order is ignored abstract PactDslJsonArrayunorderedMinMaxArray(Integer minSize, Integer maxSize)Array element of min and max size where order is ignored abstract DslPartcloseArray()Close of the previous array element abstract PactDslJsonBodyeachLike(String name)Array field where each element must match the following object abstract PactDslJsonBodyeachLike(String name, DslPart obj)Array field where each element must match the following object abstract PactDslJsonBodyeachLike()Array element where each element of the array must match the following object abstract PactDslJsonArrayeachLike(DslPart obj)Array element where each element of the array must match the provided object abstract PactDslJsonBodyeachLike(String name, Integer numberExamples)Array field where each element must match the following object abstract PactDslJsonBodyeachLike(Integer numberExamples)Array element where each element of the array must match the following object abstract PactDslJsonBodyminArrayLike(String name, Integer size)Array field with a minimum size and each element must match the following object abstract PactDslJsonBodyminArrayLike(Integer size)Array element with a minimum size and each element of the array must match the following object abstract PactDslJsonBodyminArrayLike(String name, Integer size, DslPart obj)Array field with a minimum size and each element must match the provided object abstract PactDslJsonArrayminArrayLike(Integer size, DslPart obj)Array element with a minumum size and each element of the array must match the provided object abstract PactDslJsonBodyminArrayLike(String name, Integer size, Integer numberExamples)Array field with a minumum size and each element must match the following object abstract PactDslJsonBodyminArrayLike(Integer size, Integer numberExamples)Array element with a minimum size and each element of the array must match the following object abstract PactDslJsonBodymaxArrayLike(String name, Integer size)Array field with a maximum size and each element must match the following object abstract PactDslJsonBodymaxArrayLike(Integer size)Array element with a maximum size and each element of the array must match the following object abstract PactDslJsonBodymaxArrayLike(String name, Integer size, DslPart obj)Array field with a maximum size and each element must match the provided object abstract PactDslJsonArraymaxArrayLike(Integer size, DslPart obj)Array element with a maximum size and each element of the array must match the provided object abstract PactDslJsonBodymaxArrayLike(String name, Integer size, Integer numberExamples)Array field with a maximum size and each element must match the following object abstract PactDslJsonBodymaxArrayLike(Integer size, Integer numberExamples)Array element with a maximum size and each element of the array must match the following object abstract PactDslJsonBodyminMaxArrayLike(String name, Integer minSize, Integer maxSize)Array field with a minimum and maximum size and each element must match the following object abstract 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 abstract PactDslJsonBodyminMaxArrayLike(Integer minSize, Integer maxSize)Array element with a minimum and maximum size and each element of the array must match the following object abstract 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 abstract 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 abstract 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 abstract PactDslJsonArrayeachArrayLike(String name)Array field where each element is an array and must match the following object abstract PactDslJsonArrayeachArrayLike()Array element where each element of the array is an array and must match the following object abstract PactDslJsonArrayeachArrayLike(String name, Integer numberExamples)Array field where each element is an array and must match the following object abstract PactDslJsonArrayeachArrayLike(Integer numberExamples)Array element where each element of the array is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMaxLike(String name, Integer size)Array field where each element is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMaxLike(Integer size)Array element where each element of the array is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMaxLike(String name, Integer numberExamples, Integer size)Array field where each element is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMaxLike(Integer numberExamples, Integer size)Array element where each element of the array is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMinLike(String name, Integer size)Array field where each element is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMinLike(Integer size)Array element where each element of the array is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMinLike(String name, Integer numberExamples, Integer size)Array field where each element is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMinLike(Integer numberExamples, Integer size)Array element where each element of the array is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize)Array field where each element is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMinMaxLike(Integer minSize, Integer maxSize)Array element where each element of the array is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMinMaxLike(String name, Integer numberExamples, Integer minSize, Integer maxSize)Array field where each element is an array and must match the following object abstract PactDslJsonArrayeachArrayWithMinMaxLike(Integer numberExamples, Integer minSize, Integer maxSize)Array element where each element of the array is an array and must match the following object abstract PactDslJsonBodyobject(String name)Object field abstract PactDslJsonBodyobject()Object element abstract DslPartcloseObject()Close off the previous object final PactDslJsonBodyasBody()final PactDslJsonArrayasArray()abstract DslPartclose()This closes off the object graph build from the DSL in case any closeObject|Array methods have not been called. abstract DslPartmatchUrl(String name, String basePath, Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions abstract DslPartmatchUrl(String basePath, Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions abstract DslPartmatchUrl2(String name, Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions. abstract DslPartmatchUrl2(Object pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions. abstract DslPartarrayContaining(String name)Matches the items in an array against a number of variants. -
-
Method Detail
-
getRootPath
final String getRootPath()
-
getRootName
final String getRootName()
-
getMatchers
final MatchingRuleCategory getMatchers()
-
setMatchers
final Unit setMatchers(MatchingRuleCategory matchers)
-
getGenerators
final Generators getGenerators()
-
setGenerators
final Unit setGenerators(Generators generators)
-
getBody
abstract JsonValue getBody()
-
putObjectPrivate
abstract Unit putObjectPrivate(DslPart obj)
-
putArrayPrivate
abstract Unit putArrayPrivate(DslPart obj)
-
array
abstract PactDslJsonArray array(String name)
Field which is an array
- Parameters:
name- field name
-
array
abstract PactDslJsonArray array()
Element as an array
-
unorderedArray
abstract PactDslJsonArray unorderedArray(String name)
Array field where order is ignored
- Parameters:
name- field name
-
unorderedArray
abstract PactDslJsonArray unorderedArray()
Array element where order is ignored
-
unorderedMinArray
abstract PactDslJsonArray unorderedMinArray(String name, Integer size)
Array field of min size where order is ignored
- Parameters:
name- field namesize- minimum size
-
unorderedMinArray
abstract PactDslJsonArray unorderedMinArray(Integer size)
Array element of min size where order is ignored
- Parameters:
size- minimum size
-
unorderedMaxArray
abstract PactDslJsonArray unorderedMaxArray(String name, Integer size)
Array field of max size where order is ignored
- Parameters:
name- field namesize- maximum size
-
unorderedMaxArray
abstract PactDslJsonArray unorderedMaxArray(Integer size)
Array element of max size where order is ignored
- Parameters:
size- maximum size
-
unorderedMinMaxArray
abstract 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
abstract PactDslJsonArray unorderedMinMaxArray(Integer minSize, Integer maxSize)
Array element of min and max size where order is ignored
- Parameters:
minSize- minimum sizemaxSize- maximum size
-
closeArray
abstract DslPart closeArray()
Close of the previous array element
-
eachLike
abstract PactDslJsonBody eachLike(String name)
Array field where each element must match the following object
- Parameters:
name- field name
-
eachLike
abstract PactDslJsonBody eachLike(String name, DslPart obj)
Array field where each element must match the following object
- Parameters:
name- field name
-
eachLike
abstract PactDslJsonBody eachLike()
Array element where each element of the array must match the following object
-
eachLike
abstract PactDslJsonArray eachLike(DslPart obj)
Array element where each element of the array must match the provided object
-
eachLike
abstract 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
abstract PactDslJsonBody eachLike(Integer numberExamples)
Array element where each element of the array must match the following object
- Parameters:
numberExamples- number of examples to generate
-
minArrayLike
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
-
eachArrayLike
abstract PactDslJsonArray eachArrayLike(String name)
Array field where each element is an array and must match the following object
- Parameters:
name- field name
-
eachArrayLike
abstract PactDslJsonArray eachArrayLike()
Array element where each element of the array is an array and must match the following object
-
eachArrayLike
abstract 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
abstract 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
-
eachArrayWithMaxLike
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
abstract 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
-
object
abstract PactDslJsonBody object(String name)
Object field
- Parameters:
name- field name
-
object
abstract PactDslJsonBody object()
Object element
-
closeObject
abstract DslPart closeObject()
Close off the previous object
-
asBody
final PactDslJsonBody asBody()
-
asArray
final PactDslJsonArray asArray()
-
close
abstract DslPart close()
This closes off the object graph build from the DSL in case any closeObject|Array methods have not been called.
-
matchUrl
abstract 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.
-
matchUrl
abstract DslPart 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.
-
matchUrl2
abstract DslPart 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
abstract 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
abstract 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
-
-
-
-