-
public class LambdaDslObject
-
-
Constructor Summary
Constructors Constructor Description LambdaDslObject(PactDslJsonBody object)
-
Method Summary
Modifier and Type Method Description PactDslJsonBodygetPactDslObject()Get the raw PactDslJsonBody which is abstracted with LambdaDslObject LambdaDslObjectstringValue(String name, String value)Attribute that must be the specified value LambdaDslObjectstringType(String name, String example)Attribute that can be any string LambdaDslObjectstringType(String name)Attribute that can be any string LambdaDslObjectstringType(Array<String> names)Attributes that can be any string LambdaDslObjectstringMatcher(String name, String regex)Attribute that must match the regular expression LambdaDslObjectstringMatcher(String name, String regex, String example)Attribute that must match the regular expression LambdaDslObjectnumberValue(String name, Number value)Attribute that must be the specified number LambdaDslObjectnumberType(String name, Number example)Attribute that can be any number LambdaDslObjectnumberType(Array<String> names)Attributes that can be any number LambdaDslObjectintegerType(String name, Integer example)Attribute that must be an integer LambdaDslObjectintegerType(Array<String> names)Attributes that must be an integer LambdaDslObjectdecimalType(String name, BigDecimal example)Attribute that must be a decimalType value LambdaDslObjectdecimalType(String name, Double example)Attribute that must be a decimalType value LambdaDslObjectdecimalType(Array<String> names)Attributes that must be decimal values LambdaDslObjectbooleanValue(String name, Boolean value)Attribute that must be the specified boolean LambdaDslObjectbooleanType(String name, Boolean example)Attribute that must be a boolean LambdaDslObjectbooleanType(Array<String> names)Attributes that must be a boolean LambdaDslObjectid()Attribute named 'id' that must be a numeric identifier LambdaDslObjectid(String name)Attribute that must be a numeric identifier LambdaDslObjectid(String name, Long example)Attribute that must be a numeric identifier LambdaDslObjectuuid(String name)Attribute that must be encoded as an UUID LambdaDslObjectuuid(String name, UUID example)Attribute that must be encoded as an UUID LambdaDslObjectdate()Attribute named 'date' that must be formatted as an ISO date LambdaDslObjectdate(String name)Attribute that must be formatted as an ISO date LambdaDslObjectdate(String name, String format)Attribute that must match the provided date format LambdaDslObjectdate(String name, String format, Date example)Attribute that must match the provided date format LambdaDslObjectdate(String name, String format, Date example, TimeZone timeZone)Attribute that must match the provided date format LambdaDslObjectdate(String name, String format, ZonedDateTime example)Attribute that must match the provided date format LambdaDslObjecttime()Attribute named 'time' that must be an ISO formatted time LambdaDslObjecttime(String name)Attribute that must be an ISO formatted time LambdaDslObjecttime(String name, String format)Attribute that must match the provided time format LambdaDslObjecttime(String name, String format, Date example)Attribute that must match the provided time format LambdaDslObjecttime(String name, String format, Date example, TimeZone timeZone)Attribute that must match the provided time format LambdaDslObjecttime(String name, String format, ZonedDateTime example)Attribute that must match the provided time format LambdaDslObjecttimestamp()Attribute named 'timestamp' that must be an ISO formatted timestamp LambdaDslObjecttimestamp(String name)Attribute that must be an ISO formatted timestamp LambdaDslObjecttimestamp(String name, String format)Attribute that must match the given timestamp format LambdaDslObjecttimestamp(String name, String format, Date example)Attribute that must match the given timestamp format LambdaDslObjecttimestamp(String name, String format, Instant example)Attribute that must match the given timestamp format LambdaDslObjecttimestamp(String name, String format, Date example, TimeZone timeZone)Attribute that must match the given timestamp format LambdaDslObjecttimestamp(String name, String format, ZonedDateTime example)Attribute that must match the given timestamp format LambdaDslObjectdatetime(String name)Attribute that must be an ISO formatted datetime LambdaDslObjectdatetime(String name, String format)Attribute that must match the given datetime format LambdaDslObjectdatetime(String name, String format, Date example)Attribute that must match the given datetime format LambdaDslObjectdatetime(String name, String format, Instant example)Attribute that must match the given datetime format LambdaDslObjectdatetime(String name, String format, Date example, TimeZone timeZone)Attribute that must match the given datetime format LambdaDslObjectdatetime(String name, String format, ZonedDateTime example)Attribute that must match the given timestamp format LambdaDslObjectipV4Address(String name)Attribute that must be an IP4 address LambdaDslObjectvalueFromProviderState(String name, String expression, Object example)Attribute that will have its value injected from the provider state LambdaDslObjectand(String name, Object value, Array<MatchingRule> rules)Combine all the matchers using AND LambdaDslObjector(String name, Object value, Array<MatchingRule> rules)Combine all the matchers using OR LambdaDslObjectarray(String name, Consumer<LambdaDslJsonArray> array)Attribute that is an array LambdaDslObjectobject(String name, Consumer<LambdaDslObject> nestedObject)Attribute that is a JSON object LambdaDslObjecteachLike(String name, Consumer<LambdaDslObject> nestedObject)Attribute that is an array where each item must match the following example LambdaDslObjecteachLike(String name, int numberExamples, Consumer<LambdaDslObject> nestedObject)Attribute that is an array where each item must match the following example LambdaDslObjecteachLike(String name, PactDslJsonRootValue value)Attribute that is an array where each item is a primitive that must match the provided value LambdaDslObjecteachLike(String name, PactDslJsonRootValue value, int numberExamples)Attribute that is an array where each item is a primitive that must match the provided value LambdaDslObjectminArrayLike(String name, Integer size, Consumer<LambdaDslObject> nestedObject)Attribute that is an array with a minimum size where each item must match the following example LambdaDslObjectminArrayLike(String name, Integer size, int numberExamples, Consumer<LambdaDslObject> nestedObject)Attribute that is an array with a minimum size where each item must match the following example LambdaDslObjectminArrayLike(String name, Integer size, PactDslJsonRootValue value, int numberExamples)Attribute that is an array of values with a minimum size that are not objects where each item must match the following example LambdaDslObjectmaxArrayLike(String name, Integer size, Consumer<LambdaDslObject> nestedObject)Attribute that is an array with a maximum size where each item must match the following example LambdaDslObjectmaxArrayLike(String name, Integer size, int numberExamples, Consumer<LambdaDslObject> nestedObject)Attribute that is an array with a maximum size where each item must match the following example LambdaDslObjectmaxArrayLike(String name, Integer size, PactDslJsonRootValue value, int numberExamples)Attribute that is an array of values with a maximum size that are not objects where each item must match the following example LambdaDslObjectminMaxArrayLike(String name, Integer minSize, Integer maxSize, Consumer<LambdaDslObject> nestedObject)Attribute that is an array with a minimum and maximum size where each item must match the following example LambdaDslObjectminMaxArrayLike(String name, Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslObject> nestedObject)Attribute that is an array with a minimum and maximum size where each item must match the following example LambdaDslObjectminMaxArrayLike(String name, Integer minSize, Integer maxSize, PactDslJsonRootValue value, int numberExamples)Attribute that is an array of values with a minimum and maximum size that are not objects where each item must match the following example LambdaDslObjectnullValue(String fieldName)Sets the field to a null value LambdaDslObjecteachArrayLike(String name, Consumer<LambdaDslJsonArray> nestedArray)Array field where each element is an array and must match the following object LambdaDslObjecteachArrayLike(String name, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray)Array field where each element is an array and must match the following object LambdaDslObjecteachArrayWithMaxLike(String name, Integer size, Consumer<LambdaDslJsonArray> nestedArray)Array field where each element is an array and must match the following object. LambdaDslObjecteachArrayWithMaxLike(String name, int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray)Array field where each element is an array and must match the following object LambdaDslObjecteachArrayWithMinLike(String name, Integer size, Consumer<LambdaDslJsonArray> nestedArray)Array field where each element is an array and must match the following object. LambdaDslObjecteachArrayWithMinLike(String name, int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray)Array field where each element is an array and must match the following object LambdaDslObjecteachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize, Consumer<LambdaDslJsonArray> nestedArray)Array field where each element is an array and must match the following object. LambdaDslObjecteachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray)Array field where each element is an array and must match the following object LambdaDslObjecteachKeyMappedToAnArrayLike(String exampleKey, Consumer<LambdaDslObject> nestedObject)Accepts any key, and each key is mapped to a list of items that must match the following object definition. LambdaDslObjecteachKeyLike(String exampleKey, Consumer<LambdaDslObject> nestedObject)Accepts any key, and each key is mapped to a map that must match the following object definition. LambdaDslObjecteachKeyLike(String exampleKey, PactDslJsonRootValue value)Accepts any key, and each key is mapped to a map that must match the provided object definition LambdaDslObjectdateExpression(String name, String expression)Attribute whose values are generated from the provided expression. LambdaDslObjectdateExpression(String name, String expression, String format)Attribute whose values are generated from the provided expression LambdaDslObjecttimeExpression(String name, String expression)Attribute whose values are generated from the provided expression. LambdaDslObjecttimeExpression(String name, String expression, String format)Attribute whose values are generated from the provided expression LambdaDslObjectdatetimeExpression(String name, String expression)Attribute whose values are generated from the provided expression. LambdaDslObjectdatetimeExpression(String name, String expression, String format)Attribute whose values are generated from the provided expression LambdaDslObjectunorderedArray(String name, Consumer<LambdaDslJsonArray> nestedArray)Array field where order is ignored LambdaDslObjectunorderedMinArray(String name, int size, Consumer<LambdaDslJsonArray> nestedArray)Array field of min size where order is ignored LambdaDslObjectunorderedMaxArray(String name, int size, Consumer<LambdaDslJsonArray> nestedArray)Array field of max size where order is ignored LambdaDslObjectunorderedMinMaxArray(String name, int minSize, int maxSize, Consumer<LambdaDslJsonArray> nestedArray)Array field of min and max size where order is ignored LambdaDslObjectmatchUrl(String name, String basePath, Array<Object> pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions LambdaDslObjectmatchUrl2(String name, Array<Object> pathFragments)Matches a URL that is composed of a base path and a sequence of path expressions. LambdaDslObjectarrayContaining(String name, Consumer<LambdaDslJsonArray> nestedArray)Matches the items in an array against a number of variants. -
-
Constructor Detail
-
LambdaDslObject
LambdaDslObject(PactDslJsonBody object)
-
-
Method Detail
-
getPactDslObject
PactDslJsonBody getPactDslObject()
Get the raw PactDslJsonBody which is abstracted with LambdaDslObject
-
stringValue
LambdaDslObject stringValue(String name, String value)
Attribute that must be the specified value
- Parameters:
name- attribute namevalue- string value
-
stringType
LambdaDslObject stringType(String name, String example)
Attribute that can be any string
- Parameters:
name- attribute nameexample- example value to use for generated bodies
-
stringType
LambdaDslObject stringType(String name)
Attribute that can be any string
- Parameters:
name- attribute name
-
stringType
LambdaDslObject stringType(Array<String> names)
Attributes that can be any string
- Parameters:
names- attribute names
-
stringMatcher
LambdaDslObject stringMatcher(String name, String regex)
Attribute that must match the regular expression
- Parameters:
name- attribute nameregex- regular expression
-
stringMatcher
LambdaDslObject stringMatcher(String name, String regex, String example)
Attribute that must match the regular expression
- Parameters:
name- attribute nameregex- regular expressionexample- example value to use for generated bodies
-
numberValue
LambdaDslObject numberValue(String name, Number value)
Attribute that must be the specified number
- Parameters:
name- attribute namevalue- number value
-
numberType
LambdaDslObject numberType(String name, Number example)
Attribute that can be any number
- Parameters:
name- attribute nameexample- example number to use for generated bodies
-
numberType
LambdaDslObject numberType(Array<String> names)
Attributes that can be any number
- Parameters:
names- attribute names
-
integerType
LambdaDslObject integerType(String name, Integer example)
Attribute that must be an integer
- Parameters:
name- attribute nameexample- example integer value to use for generated bodies
-
integerType
LambdaDslObject integerType(Array<String> names)
Attributes that must be an integer
- Parameters:
names- attribute names
-
decimalType
LambdaDslObject decimalType(String name, BigDecimal example)
Attribute that must be a decimalType value
- Parameters:
name- attribute nameexample- example decimalType value
-
decimalType
LambdaDslObject decimalType(String name, Double example)
Attribute that must be a decimalType value
- Parameters:
name- attribute nameexample- example decimalType value
-
decimalType
LambdaDslObject decimalType(Array<String> names)
Attributes that must be decimal values
- Parameters:
names- attribute names
-
booleanValue
LambdaDslObject booleanValue(String name, Boolean value)
Attribute that must be the specified boolean
- Parameters:
name- attribute namevalue- boolean value
-
booleanType
LambdaDslObject booleanType(String name, Boolean example)
Attribute that must be a boolean
- Parameters:
name- attribute nameexample- example boolean to use for generated bodies
-
booleanType
LambdaDslObject booleanType(Array<String> names)
Attributes that must be a boolean
- Parameters:
names- attribute names
-
id
LambdaDslObject id()
Attribute named 'id' that must be a numeric identifier
-
id
LambdaDslObject id(String name)
Attribute that must be a numeric identifier
- Parameters:
name- attribute name
-
id
LambdaDslObject id(String name, Long example)
Attribute that must be a numeric identifier
- Parameters:
name- attribute nameexample- example id to use for generated bodies
-
uuid
LambdaDslObject uuid(String name)
Attribute that must be encoded as an UUID
- Parameters:
name- attribute name
-
uuid
LambdaDslObject uuid(String name, UUID example)
Attribute that must be encoded as an UUID
- Parameters:
name- attribute nameexample- example UUID to use for generated bodies
-
date
LambdaDslObject date()
Attribute named 'date' that must be formatted as an ISO date
-
date
LambdaDslObject date(String name)
Attribute that must be formatted as an ISO date
- Parameters:
name- attribute name
-
date
LambdaDslObject date(String name, String format)
Attribute that must match the provided date format
- Parameters:
name- attribute dateformat- date format to match
-
date
LambdaDslObject date(String name, String format, Date example)
Attribute that must match the provided date format
- Parameters:
name- attribute dateformat- date format to matchexample- example date to use for generated values
-
date
LambdaDslObject date(String name, String format, Date example, TimeZone timeZone)
Attribute that must match the provided date format
- Parameters:
name- attribute dateformat- date format to matchexample- example date to use for generated valuestimeZone- time zone used for formatting of example date
-
date
LambdaDslObject date(String name, String format, ZonedDateTime example)
Attribute that must match the provided date format
- Parameters:
name- attribute dateformat- date format to matchexample- example date to use for generated values
-
time
LambdaDslObject time()
Attribute named 'time' that must be an ISO formatted time
-
time
LambdaDslObject time(String name)
Attribute that must be an ISO formatted time
- Parameters:
name- attribute name
-
time
LambdaDslObject time(String name, String format)
Attribute that must match the provided time format
- Parameters:
name- attribute timeformat- time format to match
-
time
LambdaDslObject time(String name, String format, Date example)
Attribute that must match the provided time format
- Parameters:
name- attribute nameformat- time format to matchexample- example time to use for generated values
-
time
LambdaDslObject time(String name, String format, Date example, TimeZone timeZone)
Attribute that must match the provided time format
- Parameters:
name- attribute nameformat- time format to matchexample- example time to use for generated valuestimeZone- time zone used for formatting of example time
-
time
LambdaDslObject time(String name, String format, ZonedDateTime example)
Attribute that must match the provided time format
- Parameters:
name- attribute nameformat- time format to matchexample- example time to use for generated values
-
timestamp
LambdaDslObject timestamp()
Attribute named 'timestamp' that must be an ISO formatted timestamp
-
timestamp
@Deprecated() LambdaDslObject timestamp(String name)
Attribute that must be an ISO formatted timestamp
- Parameters:
name- attribute name
-
timestamp
@Deprecated() LambdaDslObject timestamp(String name, String format)
Attribute that must match the given timestamp format
- Parameters:
name- attribute nameformat- timestamp format
-
timestamp
@Deprecated() LambdaDslObject timestamp(String name, String format, Date example)
Attribute that must match the given timestamp format
- Parameters:
name- attribute nameformat- timestamp formatexample- example date and time to use for generated bodies
-
timestamp
@Deprecated() LambdaDslObject timestamp(String name, String format, Instant example)
Attribute that must match the given timestamp format
- Parameters:
name- attribute nameformat- timestamp formatexample- example date and time to use for generated bodies
-
timestamp
@Deprecated() LambdaDslObject timestamp(String name, String format, Date example, TimeZone timeZone)
Attribute that must match the given timestamp format
- Parameters:
name- attribute nameformat- timestamp formatexample- example date and time to use for generated bodiestimeZone- time zone used for formatting of example date and time
-
timestamp
@Deprecated() LambdaDslObject timestamp(String name, String format, ZonedDateTime example)
Attribute that must match the given timestamp format
- Parameters:
name- attribute nameformat- timestamp formatexample- example date and time to use for generated bodies
-
datetime
LambdaDslObject datetime(String name)
Attribute that must be an ISO formatted datetime
- Parameters:
name- attribute name
-
datetime
LambdaDslObject datetime(String name, String format)
Attribute that must match the given datetime format
- Parameters:
name- attribute nameformat- datetime format
-
datetime
LambdaDslObject datetime(String name, String format, Date example)
Attribute that must match the given datetime format
- Parameters:
name- attribute nameformat- datetime formatexample- example date and time to use for generated bodies
-
datetime
LambdaDslObject datetime(String name, String format, Instant example)
Attribute that must match the given datetime format
- Parameters:
name- attribute nameformat- datetime formatexample- example date and time to use for generated bodies
-
datetime
LambdaDslObject datetime(String name, String format, Date example, TimeZone timeZone)
Attribute that must match the given datetime format
- Parameters:
name- attribute nameformat- datetime formatexample- example date and time to use for generated bodiestimeZone- time zone used for formatting of example date and time
-
datetime
LambdaDslObject datetime(String name, String format, ZonedDateTime example)
Attribute that must match the given timestamp format
- Parameters:
name- attribute nameformat- datetime formatexample- example date and time to use for generated bodies
-
ipV4Address
LambdaDslObject ipV4Address(String name)
Attribute that must be an IP4 address
- Parameters:
name- attribute name
-
valueFromProviderState
LambdaDslObject valueFromProviderState(String name, String expression, Object example)
Attribute that will have its value injected from the provider state
- Parameters:
name- Attribute nameexpression- Expression to be evaluated from the provider stateexample- Example value to be used in the consumer test
-
and
LambdaDslObject and(String name, Object value, Array<MatchingRule> rules)
Combine all the matchers using AND
- Parameters:
name- Attribute namevalue- Attribute example valuerules- Matching rules to apply
-
or
LambdaDslObject or(String name, Object value, Array<MatchingRule> rules)
Combine all the matchers using OR
- Parameters:
name- Attribute namevalue- Attribute example valuerules- Matching rules to apply
-
array
LambdaDslObject array(String name, Consumer<LambdaDslJsonArray> array)
Attribute that is an array
- Parameters:
name- field name
-
object
LambdaDslObject object(String name, Consumer<LambdaDslObject> nestedObject)
Attribute that is a JSON object
- Parameters:
name- field name
-
eachLike
LambdaDslObject eachLike(String name, Consumer<LambdaDslObject> nestedObject)
Attribute that is an array where each item must match the following example
- Parameters:
name- field name
-
eachLike
LambdaDslObject eachLike(String name, int numberExamples, Consumer<LambdaDslObject> nestedObject)
Attribute that is an array where each item must match the following example
- Parameters:
name- field namenumberExamples- number of examples to generate
-
eachLike
LambdaDslObject eachLike(String name, PactDslJsonRootValue value)
Attribute that is an array where each item is a primitive that must match the provided value
- Parameters:
name- field namevalue- Value that each item in the array must match
-
eachLike
LambdaDslObject eachLike(String name, PactDslJsonRootValue value, int numberExamples)
Attribute that is an array where each item is a primitive that must match the provided value
- Parameters:
name- field namevalue- Value that each item in the array must matchnumberExamples- Number of examples to generate
-
minArrayLike
LambdaDslObject minArrayLike(String name, Integer size, Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a minimum size where each item must match the following example
- Parameters:
name- field namesize- minimum size of the array
-
minArrayLike
LambdaDslObject minArrayLike(String name, Integer size, int numberExamples, Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a minimum size where each item must match the following example
- Parameters:
name- field namesize- minimum size of the arraynumberExamples- number of examples to generate
-
minArrayLike
LambdaDslObject minArrayLike(String name, Integer size, PactDslJsonRootValue value, int numberExamples)
Attribute that is an array of values with a minimum size that are not objects where each item must match the following example
- Parameters:
name- field namesize- minimum size of the arrayvalue- Value to use to match each itemnumberExamples- number of examples to generate
-
maxArrayLike
LambdaDslObject maxArrayLike(String name, Integer size, Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a maximum size where each item must match the following example
- Parameters:
name- field namesize- maximum size of the array
-
maxArrayLike
LambdaDslObject maxArrayLike(String name, Integer size, int numberExamples, Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a maximum size where each item must match the following example
- Parameters:
name- field namesize- maximum size of the arraynumberExamples- number of examples to generate
-
maxArrayLike
LambdaDslObject maxArrayLike(String name, Integer size, PactDslJsonRootValue value, int numberExamples)
Attribute that is an array of values with a maximum size that are not objects where each item must match the following example
- Parameters:
name- field namesize- maximum size of the arrayvalue- Value to use to match each itemnumberExamples- number of examples to generate
-
minMaxArrayLike
LambdaDslObject minMaxArrayLike(String name, Integer minSize, Integer maxSize, Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a minimum and maximum size where each item must match the following example
- Parameters:
name- field nameminSize- minimum size of the arraymaxSize- maximum size of the array
-
minMaxArrayLike
LambdaDslObject minMaxArrayLike(String name, Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a minimum and maximum size where each item must match the following example
- Parameters:
name- field nameminSize- minimum size of the arraymaxSize- maximum size of the arraynumberExamples- number of examples to generate
-
minMaxArrayLike
LambdaDslObject minMaxArrayLike(String name, Integer minSize, Integer maxSize, PactDslJsonRootValue value, int numberExamples)
Attribute that is an array of values with a minimum and maximum size that are not objects where each item must match the following example
- Parameters:
name- field nameminSize- minimum size of the arraymaxSize- maximum size of the arrayvalue- Value to use to match each itemnumberExamples- number of examples to generate
-
nullValue
LambdaDslObject nullValue(String fieldName)
Sets the field to a null value
- Parameters:
fieldName- field name
-
eachArrayLike
LambdaDslObject eachArrayLike(String name, Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object
- Parameters:
name- field name
-
eachArrayLike
LambdaDslObject eachArrayLike(String name, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object
- Parameters:
name- field namenumberExamples- number of examples to generate
-
eachArrayWithMaxLike
LambdaDslObject eachArrayWithMaxLike(String name, Integer size, Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object. This will generate 1 example value, if you want to change that number use
- Parameters:
name- field namesize- Maximum size of the outer array
-
eachArrayWithMaxLike
LambdaDslObject eachArrayWithMaxLike(String name, int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray)
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
-
eachArrayWithMinLike
LambdaDslObject eachArrayWithMinLike(String name, Integer size, Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object. This will generate 1 example value, if you want to change that number use
- Parameters:
name- field namesize- Minimum size of the outer array
-
eachArrayWithMinLike
LambdaDslObject eachArrayWithMinLike(String name, int numberExamples, Integer size, Consumer<LambdaDslJsonArray> nestedArray)
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
-
eachArrayWithMinMaxLike
LambdaDslObject eachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize, Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object. This will generate 1 example value, if you want to change that number use
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
eachArrayWithMinMaxLike
LambdaDslObject eachArrayWithMinMaxLike(String name, Integer minSize, Integer maxSize, int numberExamples, Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum sizenumberExamples- number of examples to generate
-
eachKeyMappedToAnArrayLike
LambdaDslObject eachKeyMappedToAnArrayLike(String exampleKey, Consumer<LambdaDslObject> nestedObject)
Accepts any key, and each key is mapped to a list of items that must match the following object definition.
- Parameters:
exampleKey- Example key to use for generating bodies
-
eachKeyLike
LambdaDslObject eachKeyLike(String exampleKey, Consumer<LambdaDslObject> nestedObject)
Accepts any key, and each key is mapped to a map that must match the following object definition.
- Parameters:
exampleKey- Example key to use for generating bodies
-
eachKeyLike
LambdaDslObject eachKeyLike(String exampleKey, PactDslJsonRootValue value)
Accepts any key, and each key is mapped to a map that must match the provided object definition
- Parameters:
exampleKey- Example key to use for generating bodiesvalue- Value to use for matching and generated bodies
-
dateExpression
LambdaDslObject dateExpression(String name, String expression)
Attribute whose values are generated from the provided expression. Will use an ISO format.
- Parameters:
name- Attribute nameexpression- Date expression
-
dateExpression
LambdaDslObject dateExpression(String name, String expression, String format)
Attribute whose values are generated from the provided expression
- Parameters:
name- Attribute nameexpression- Date expressionformat- Date format to use for values
-
timeExpression
LambdaDslObject timeExpression(String name, String expression)
Attribute whose values are generated from the provided expression. Will use an ISO format.
- Parameters:
name- Attribute nameexpression- Time expression
-
timeExpression
LambdaDslObject timeExpression(String name, String expression, String format)
Attribute whose values are generated from the provided expression
- Parameters:
name- Attribute nameexpression- Time expressionformat- Time format to use for values
-
datetimeExpression
LambdaDslObject datetimeExpression(String name, String expression)
Attribute whose values are generated from the provided expression. Will use an ISO format.
- Parameters:
name- Attribute nameexpression- Datetime expression
-
datetimeExpression
LambdaDslObject datetimeExpression(String name, String expression, String format)
Attribute whose values are generated from the provided expression
- Parameters:
name- Attribute nameexpression- Datetime expressionformat- Datetime format to use for values
-
unorderedArray
LambdaDslObject unorderedArray(String name, Consumer<LambdaDslJsonArray> nestedArray)
Array field where order is ignored
- Parameters:
name- field name
-
unorderedMinArray
LambdaDslObject unorderedMinArray(String name, int size, Consumer<LambdaDslJsonArray> nestedArray)
Array field of min size where order is ignored
- Parameters:
name- field namesize- minimum size
-
unorderedMaxArray
LambdaDslObject unorderedMaxArray(String name, int size, Consumer<LambdaDslJsonArray> nestedArray)
Array field of max size where order is ignored
- Parameters:
name- field namesize- maximum size
-
unorderedMinMaxArray
LambdaDslObject unorderedMinMaxArray(String name, int minSize, int maxSize, Consumer<LambdaDslJsonArray> nestedArray)
Array field of min and max size where order is ignored
- Parameters:
name- field nameminSize- minimum sizemaxSize- maximum size
-
matchUrl
LambdaDslObject matchUrl(String name, String basePath, Array<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
LambdaDslObject matchUrl2(String name, Array<Object> pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions. The base path of the mock server will be used.
- Parameters:
name- Attribute namepathFragments- Series of path fragments to match on.
-
arrayContaining
LambdaDslObject arrayContaining(String name, Consumer<LambdaDslJsonArray> nestedArray)
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
-
-
-
-