Package au.com.dius.pact.consumer.dsl
Class LambdaDslObject
- java.lang.Object
-
- au.com.dius.pact.consumer.dsl.LambdaDslObject
-
- Direct Known Subclasses:
LambdaDslJsonBody
public class LambdaDslObject extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description LambdaDslObject
and(java.lang.String name, java.lang.Object value, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using ANDLambdaDslObject
array(java.lang.String name, java.util.function.Consumer<LambdaDslJsonArray> array)
Attribute that is an arrayLambdaDslObject
arrayContaining(java.lang.String name, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Matches the items in an array against a number of variants.LambdaDslObject
booleanType(java.lang.String... names)
Attributes that must be a booleanLambdaDslObject
booleanType(java.lang.String name, java.lang.Boolean example)
Attribute that must be a booleanLambdaDslObject
booleanValue(java.lang.String name, java.lang.Boolean value)
Attribute that must be the specified booleanLambdaDslObject
date()
Attribute named 'date' that must be formatted as an ISO dateLambdaDslObject
date(java.lang.String name)
Attribute that must be formatted as an ISO dateLambdaDslObject
date(java.lang.String name, java.lang.String format)
Attribute that must match the provided date formatLambdaDslObject
date(java.lang.String name, java.lang.String format, java.time.LocalDate example)
Attribute that must match the provided date formatLambdaDslObject
date(java.lang.String name, java.lang.String format, java.time.ZonedDateTime example)
Attribute that must match the provided date formatLambdaDslObject
date(java.lang.String name, java.lang.String format, java.util.Date example)
Attribute that must match the provided date formatLambdaDslObject
date(java.lang.String name, java.lang.String format, java.util.Date example, java.util.TimeZone timeZone)
Attribute that must match the provided date formatLambdaDslObject
dateExpression(java.lang.String name, java.lang.String expression)
Attribute whose values are generated from the provided expression.LambdaDslObject
dateExpression(java.lang.String name, java.lang.String expression, java.lang.String format)
Attribute whose values are generated from the provided expressionLambdaDslObject
datetime(java.lang.String name)
Deprecated.Use datetimeLambdaDslObject
datetime(java.lang.String name, java.lang.String format)
Attribute that must match the given datetime formatLambdaDslObject
datetime(java.lang.String name, java.lang.String format, java.time.Instant example)
Attribute that must match the given datetime formatLambdaDslObject
datetime(java.lang.String name, java.lang.String format, java.time.ZonedDateTime example)
Attribute that must match the given timestamp formatLambdaDslObject
datetime(java.lang.String name, java.lang.String format, java.util.Date example)
Attribute that must match the given datetime formatLambdaDslObject
datetime(java.lang.String name, java.lang.String format, java.util.Date example, java.util.TimeZone timeZone)
Attribute that must match the given datetime formatLambdaDslObject
datetimeExpression(java.lang.String name, java.lang.String expression)
Attribute whose values are generated from the provided expression.LambdaDslObject
datetimeExpression(java.lang.String name, java.lang.String expression, java.lang.String format)
Attribute whose values are generated from the provided expressionLambdaDslObject
decimalMatching(java.lang.String name, java.lang.String regex, java.lang.Double example)
Attribute that can be any number decimal number (has significant digits after the decimal point) and which must match the provided regular expressionLambdaDslObject
decimalType(java.lang.String... names)
Attributes that must be decimal values (have significant digits after the decimal point)LambdaDslObject
decimalType(java.lang.String name, java.lang.Double example)
Attribute that must be a decimalType value (has significant digits after the decimal point)LambdaDslObject
decimalType(java.lang.String name, java.math.BigDecimal example)
Attribute that must be a decimalType value (has significant digits after the decimal point)LambdaDslObject
eachArrayLike(java.lang.String name, int numberExamples, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following objectLambdaDslObject
eachArrayLike(java.lang.String name, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following objectLambdaDslObject
eachArrayWithMaxLike(java.lang.String name, int numberExamples, java.lang.Integer size, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following objectLambdaDslObject
eachArrayWithMaxLike(java.lang.String name, java.lang.Integer size, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object.LambdaDslObject
eachArrayWithMinLike(java.lang.String name, int numberExamples, java.lang.Integer size, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following objectLambdaDslObject
eachArrayWithMinLike(java.lang.String name, java.lang.Integer size, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object.LambdaDslObject
eachArrayWithMinMaxLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, int numberExamples, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following objectLambdaDslObject
eachArrayWithMinMaxLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object.LambdaDslObject
eachKeyLike(java.lang.String exampleKey, au.com.dius.pact.consumer.dsl.PactDslJsonRootValue value)
Accepts any key, and each key is mapped to a map that must match the provided object definitionLambdaDslObject
eachKeyLike(java.lang.String exampleKey, java.util.function.Consumer<LambdaDslObject> nestedObject)
Accepts any key, and each key is mapped to a map that must match the following object definition.LambdaDslObject
eachKeyMappedToAnArrayLike(java.lang.String exampleKey, java.util.function.Consumer<LambdaDslObject> nestedObject)
Accepts any key, and each key is mapped to a list of items that must match the following object definition.LambdaDslObject
eachLike(java.lang.String name, int numberExamples, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is an array where each item must match the following exampleLambdaDslObject
eachLike(java.lang.String name, au.com.dius.pact.consumer.dsl.PactDslJsonRootValue value)
Attribute that is an array where each item is a primitive that must match the provided valueLambdaDslObject
eachLike(java.lang.String name, au.com.dius.pact.consumer.dsl.PactDslJsonRootValue value, int numberExamples)
Attribute that is an array where each item is a primitive that must match the provided valueLambdaDslObject
eachLike(java.lang.String name, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is an array where each item must match the following exampleau.com.dius.pact.consumer.dsl.PactDslJsonBody
getPactDslObject()
Get the rawPactDslJsonBody
which is abstracted withLambdaDslObject
LambdaDslObject
id()
Attribute named 'id' that must be a numeric identifierLambdaDslObject
id(java.lang.String name)
Attribute that must be a numeric identifierLambdaDslObject
id(java.lang.String name, java.lang.Long example)
Attribute that must be a numeric identifierLambdaDslObject
integerMatching(java.lang.String name, java.lang.String regex, java.lang.Integer example)
Attribute that can be any integer and which must match the provided regular expressionLambdaDslObject
integerType(java.lang.String... names)
Attributes that must be an integerLambdaDslObject
integerType(java.lang.String name, java.lang.Integer example)
Attribute that must be an integerLambdaDslObject
ipV4Address(java.lang.String name)
Attribute that must be an IP4 addressLambdaDslObject
matchUrl(java.lang.String name, java.lang.String basePath, java.lang.Object... pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressionsLambdaDslObject
matchUrl2(java.lang.String name, java.lang.Object... pathFragments)
Matches a URL that is composed of a base path and a sequence of path expressions.LambdaDslObject
maxArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a maximum size where each item must match the following exampleLambdaDslObject
maxArrayLike(java.lang.String name, java.lang.Integer size, au.com.dius.pact.consumer.dsl.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 exampleLambdaDslObject
maxArrayLike(java.lang.String name, java.lang.Integer size, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a maximum size where each item must match the following exampleLambdaDslObject
minArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a minimum size where each item must match the following exampleLambdaDslObject
minArrayLike(java.lang.String name, java.lang.Integer size, au.com.dius.pact.consumer.dsl.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 exampleLambdaDslObject
minArrayLike(java.lang.String name, java.lang.Integer size, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a minimum size where each item must match the following exampleLambdaDslObject
minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, int numberExamples, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a minimum and maximum size where each item must match the following exampleLambdaDslObject
minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, au.com.dius.pact.consumer.dsl.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 exampleLambdaDslObject
minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is an array with a minimum and maximum size where each item must match the following exampleLambdaDslObject
nullValue(java.lang.String fieldName)
Sets the field to a null valueLambdaDslObject
numberMatching(java.lang.String name, java.lang.String regex, java.lang.Number example)
Attribute that can be any number and which must match the provided regular expressionLambdaDslObject
numberType(java.lang.String... names)
Attributes that can be any numberLambdaDslObject
numberType(java.lang.String name, java.lang.Number example)
Attribute that can be any numberLambdaDslObject
numberValue(java.lang.String name, java.lang.Number value)
Attribute that must be the specified numberLambdaDslObject
object(java.lang.String name, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is a JSON objectLambdaDslObject
or(java.lang.String name, java.lang.Object value, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using ORLambdaDslObject
stringMatcher(java.lang.String name, java.lang.String regex)
Attribute that must match the regular expressionLambdaDslObject
stringMatcher(java.lang.String name, java.lang.String regex, java.lang.String example)
Attribute that must match the regular expressionLambdaDslObject
stringType(java.lang.String name)
Attribute that can be any stringLambdaDslObject
stringType(java.lang.String... names)
Attributes that can be any stringLambdaDslObject
stringType(java.lang.String name, java.lang.String example)
Attribute that can be any stringLambdaDslObject
stringValue(java.lang.String name, java.lang.String value)
Attribute that must be the specified valueLambdaDslObject
time()
Attribute named 'time' that must be an ISO formatted timeLambdaDslObject
time(java.lang.String name)
Attribute that must be an ISO formatted timeLambdaDslObject
time(java.lang.String name, java.lang.String format)
Attribute that must match the provided time formatLambdaDslObject
time(java.lang.String name, java.lang.String format, java.time.ZonedDateTime example)
Attribute that must match the provided time formatLambdaDslObject
time(java.lang.String name, java.lang.String format, java.util.Date example)
Attribute that must match the provided time formatLambdaDslObject
time(java.lang.String name, java.lang.String format, java.util.Date example, java.util.TimeZone timeZone)
Attribute that must match the provided time formatLambdaDslObject
timeExpression(java.lang.String name, java.lang.String expression)
Attribute whose values are generated from the provided expression.LambdaDslObject
timeExpression(java.lang.String name, java.lang.String expression, java.lang.String format)
Attribute whose values are generated from the provided expressionLambdaDslObject
timestamp()
Deprecated.Use datetimeLambdaDslObject
unorderedArray(java.lang.String name, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where order is ignoredLambdaDslObject
unorderedMaxArray(java.lang.String name, int size, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field of max size where order is ignoredLambdaDslObject
unorderedMinArray(java.lang.String name, int size, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field of min size where order is ignoredLambdaDslObject
unorderedMinMaxArray(java.lang.String name, int minSize, int maxSize, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field of min and max size where order is ignoredLambdaDslObject
uuid(java.lang.String name)
Attribute that must be encoded as an UUIDLambdaDslObject
uuid(java.lang.String name, java.util.UUID example)
Attribute that must be encoded as an UUIDLambdaDslObject
valueFromProviderState(java.lang.String name, java.lang.String expression, java.lang.Object example)
Attribute that will have its value injected from the provider state
-
-
-
Method Detail
-
getPactDslObject
public au.com.dius.pact.consumer.dsl.PactDslJsonBody getPactDslObject()
Get the rawPactDslJsonBody
which is abstracted withLambdaDslObject
-
stringValue
public LambdaDslObject stringValue(java.lang.String name, java.lang.String value)
Attribute that must be the specified value- Parameters:
name
- attribute namevalue
- string value
-
stringType
public LambdaDslObject stringType(java.lang.String name, java.lang.String example)
Attribute that can be any string- Parameters:
name
- attribute nameexample
- example value to use for generated bodies
-
stringType
public LambdaDslObject stringType(java.lang.String name)
Attribute that can be any string- Parameters:
name
- attribute name
-
stringType
public LambdaDslObject stringType(java.lang.String... names)
Attributes that can be any string- Parameters:
names
- attribute names
-
stringMatcher
public LambdaDslObject stringMatcher(java.lang.String name, java.lang.String regex)
Attribute that must match the regular expression- Parameters:
name
- attribute nameregex
- regular expression
-
stringMatcher
public LambdaDslObject stringMatcher(java.lang.String name, java.lang.String regex, java.lang.String example)
Attribute that must match the regular expression- Parameters:
name
- attribute nameregex
- regular expressionexample
- example value to use for generated bodies
-
numberValue
public LambdaDslObject numberValue(java.lang.String name, java.lang.Number value)
Attribute that must be the specified number- Parameters:
name
- attribute namevalue
- number value
-
numberType
public LambdaDslObject numberType(java.lang.String name, java.lang.Number example)
Attribute that can be any number- Parameters:
name
- attribute nameexample
- example number to use for generated bodies
-
numberType
public LambdaDslObject numberType(java.lang.String... names)
Attributes that can be any number- Parameters:
names
- attribute names
-
integerType
public LambdaDslObject integerType(java.lang.String name, java.lang.Integer example)
Attribute that must be an integer- Parameters:
name
- attribute nameexample
- example integer value to use for generated bodies
-
integerType
public LambdaDslObject integerType(java.lang.String... names)
Attributes that must be an integer- Parameters:
names
- attribute names
-
decimalType
public LambdaDslObject decimalType(java.lang.String name, java.math.BigDecimal example)
Attribute that must be a decimalType value (has significant digits after the decimal point)- Parameters:
name
- attribute nameexample
- example decimalType value
-
decimalType
public LambdaDslObject decimalType(java.lang.String name, java.lang.Double example)
Attribute that must be a decimalType value (has significant digits after the decimal point)- Parameters:
name
- attribute nameexample
- example decimalType value
-
decimalType
public LambdaDslObject decimalType(java.lang.String... names)
Attributes that must be decimal values (have significant digits after the decimal point)- Parameters:
names
- attribute names
-
numberMatching
public LambdaDslObject numberMatching(java.lang.String name, java.lang.String regex, java.lang.Number example)
Attribute that can be any number and which must match the provided regular expression- Parameters:
name
- attribute nameregex
- Regular expression that the numbers string form must matchexample
- example number to use for generated bodies
-
decimalMatching
public LambdaDslObject decimalMatching(java.lang.String name, java.lang.String regex, java.lang.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:
name
- attribute nameregex
- Regular expression that the numbers string form must matchexample
- example number to use for generated bodies
-
integerMatching
public LambdaDslObject integerMatching(java.lang.String name, java.lang.String regex, java.lang.Integer example)
Attribute that can be any integer and which must match the provided regular expression- Parameters:
name
- attribute nameregex
- Regular expression that the numbers string form must matchexample
- example integer to use for generated bodies
-
booleanValue
public LambdaDslObject booleanValue(java.lang.String name, java.lang.Boolean value)
Attribute that must be the specified boolean- Parameters:
name
- attribute namevalue
- boolean value
-
booleanType
public LambdaDslObject booleanType(java.lang.String name, java.lang.Boolean example)
Attribute that must be a boolean- Parameters:
name
- attribute nameexample
- example boolean to use for generated bodies
-
booleanType
public LambdaDslObject booleanType(java.lang.String... names)
Attributes that must be a boolean- Parameters:
names
- attribute names
-
id
public LambdaDslObject id()
Attribute named 'id' that must be a numeric identifier
-
id
public LambdaDslObject id(java.lang.String name)
Attribute that must be a numeric identifier- Parameters:
name
- attribute name
-
id
public LambdaDslObject id(java.lang.String name, java.lang.Long example)
Attribute that must be a numeric identifier- Parameters:
name
- attribute nameexample
- example id to use for generated bodies
-
uuid
public LambdaDslObject uuid(java.lang.String name)
Attribute that must be encoded as an UUID- Parameters:
name
- attribute name
-
uuid
public LambdaDslObject uuid(java.lang.String name, java.util.UUID example)
Attribute that must be encoded as an UUID- Parameters:
name
- attribute nameexample
- example UUID to use for generated bodies
-
date
public LambdaDslObject date()
Attribute named 'date' that must be formatted as an ISO date
-
date
public LambdaDslObject date(java.lang.String name)
Attribute that must be formatted as an ISO date- Parameters:
name
- attribute name
-
date
public LambdaDslObject date(java.lang.String name, java.lang.String format)
Attribute that must match the provided date format- Parameters:
name
- attribute dateformat
- date format to match
-
date
public LambdaDslObject date(java.lang.String name, java.lang.String format, java.util.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
public LambdaDslObject date(java.lang.String name, java.lang.String format, java.util.Date example, java.util.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
public LambdaDslObject date(java.lang.String name, java.lang.String format, java.time.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
-
date
public LambdaDslObject date(java.lang.String name, java.lang.String format, java.time.LocalDate 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
public LambdaDslObject time()
Attribute named 'time' that must be an ISO formatted time
-
time
public LambdaDslObject time(java.lang.String name)
Attribute that must be an ISO formatted time- Parameters:
name
- attribute name
-
time
public LambdaDslObject time(java.lang.String name, java.lang.String format)
Attribute that must match the provided time format- Parameters:
name
- attribute timeformat
- time format to match
-
time
public LambdaDslObject time(java.lang.String name, java.lang.String format, java.util.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
public LambdaDslObject time(java.lang.String name, java.lang.String format, java.util.Date example, java.util.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
public LambdaDslObject time(java.lang.String name, java.lang.String format, java.time.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
@Deprecated public LambdaDslObject timestamp()
Deprecated.Use datetimeAttribute named 'timestamp' that must be an ISO formatted timestamp
-
datetime
@Deprecated public LambdaDslObject datetime(java.lang.String name)
Deprecated.Use datetimeAttribute that must be an ISO formatted datetime- Parameters:
name
- attribute name
-
datetime
public LambdaDslObject datetime(java.lang.String name, java.lang.String format)
Attribute that must match the given datetime format- Parameters:
name
- attribute nameformat
- datetime format
-
datetime
public LambdaDslObject datetime(java.lang.String name, java.lang.String format, java.util.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
public LambdaDslObject datetime(java.lang.String name, java.lang.String format, java.time.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
public LambdaDslObject datetime(java.lang.String name, java.lang.String format, java.util.Date example, java.util.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
public LambdaDslObject datetime(java.lang.String name, java.lang.String format, java.time.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
public LambdaDslObject ipV4Address(java.lang.String name)
Attribute that must be an IP4 address- Parameters:
name
- attribute name
-
valueFromProviderState
public LambdaDslObject valueFromProviderState(java.lang.String name, java.lang.String expression, java.lang.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
public LambdaDslObject and(java.lang.String name, java.lang.Object value, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using AND- Parameters:
name
- Attribute namevalue
- Attribute example valuerules
- Matching rules to apply
-
or
public LambdaDslObject or(java.lang.String name, java.lang.Object value, au.com.dius.pact.core.model.matchingrules.MatchingRule... rules)
Combine all the matchers using OR- Parameters:
name
- Attribute namevalue
- Attribute example valuerules
- Matching rules to apply
-
array
public LambdaDslObject array(java.lang.String name, java.util.function.Consumer<LambdaDslJsonArray> array)
Attribute that is an array- Parameters:
name
- field name
-
object
public LambdaDslObject object(java.lang.String name, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is a JSON object- Parameters:
name
- field name
-
eachLike
public LambdaDslObject eachLike(java.lang.String name, java.util.function.Consumer<LambdaDslObject> nestedObject)
Attribute that is an array where each item must match the following example- Parameters:
name
- field name
-
eachLike
public LambdaDslObject eachLike(java.lang.String name, int numberExamples, java.util.function.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
public LambdaDslObject eachLike(java.lang.String name, au.com.dius.pact.consumer.dsl.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
public LambdaDslObject eachLike(java.lang.String name, au.com.dius.pact.consumer.dsl.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
public LambdaDslObject minArrayLike(java.lang.String name, java.lang.Integer size, java.util.function.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
public LambdaDslObject minArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples, java.util.function.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
public LambdaDslObject minArrayLike(java.lang.String name, java.lang.Integer size, au.com.dius.pact.consumer.dsl.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
public LambdaDslObject maxArrayLike(java.lang.String name, java.lang.Integer size, java.util.function.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
public LambdaDslObject maxArrayLike(java.lang.String name, java.lang.Integer size, int numberExamples, java.util.function.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
public LambdaDslObject maxArrayLike(java.lang.String name, java.lang.Integer size, au.com.dius.pact.consumer.dsl.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
public LambdaDslObject minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, java.util.function.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
public LambdaDslObject minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, int numberExamples, java.util.function.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
public LambdaDslObject minMaxArrayLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, au.com.dius.pact.consumer.dsl.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
public LambdaDslObject nullValue(java.lang.String fieldName)
Sets the field to a null value- Parameters:
fieldName
- field name
-
eachArrayLike
public LambdaDslObject eachArrayLike(java.lang.String name, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where each element is an array and must match the following object- Parameters:
name
- field name
-
eachArrayLike
public LambdaDslObject eachArrayLike(java.lang.String name, int numberExamples, java.util.function.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
public LambdaDslObject eachArrayWithMaxLike(java.lang.String name, java.lang.Integer size, java.util.function.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 useeachArrayWithMaxLike(String, int, Integer, Consumer)
- Parameters:
name
- field namesize
- Maximum size of the outer array
-
eachArrayWithMaxLike
public LambdaDslObject eachArrayWithMaxLike(java.lang.String name, int numberExamples, java.lang.Integer size, java.util.function.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
public LambdaDslObject eachArrayWithMinLike(java.lang.String name, java.lang.Integer size, java.util.function.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 useeachArrayWithMinLike(String, int, Integer, Consumer)
- Parameters:
name
- field namesize
- Minimum size of the outer array
-
eachArrayWithMinLike
public LambdaDslObject eachArrayWithMinLike(java.lang.String name, int numberExamples, java.lang.Integer size, java.util.function.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
public LambdaDslObject eachArrayWithMinMaxLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, java.util.function.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 useeachArrayWithMinMaxLike(String, Integer, Integer, int, Consumer)
- Parameters:
name
- field nameminSize
- minimum sizemaxSize
- maximum size
-
eachArrayWithMinMaxLike
public LambdaDslObject eachArrayWithMinMaxLike(java.lang.String name, java.lang.Integer minSize, java.lang.Integer maxSize, int numberExamples, java.util.function.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 generateminSize
- minimum sizemaxSize
- maximum size
-
eachKeyMappedToAnArrayLike
public LambdaDslObject eachKeyMappedToAnArrayLike(java.lang.String exampleKey, java.util.function.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
public LambdaDslObject eachKeyLike(java.lang.String exampleKey, java.util.function.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
public LambdaDslObject eachKeyLike(java.lang.String exampleKey, au.com.dius.pact.consumer.dsl.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
public LambdaDslObject dateExpression(java.lang.String name, java.lang.String expression)
Attribute whose values are generated from the provided expression. Will use an ISO format.- Parameters:
name
- Attribute nameexpression
- Date expression
-
dateExpression
public LambdaDslObject dateExpression(java.lang.String name, java.lang.String expression, java.lang.String format)
Attribute whose values are generated from the provided expression- Parameters:
name
- Attribute nameexpression
- Date expressionformat
- Date format to use for values
-
timeExpression
public LambdaDslObject timeExpression(java.lang.String name, java.lang.String expression)
Attribute whose values are generated from the provided expression. Will use an ISO format.- Parameters:
name
- Attribute nameexpression
- Time expression
-
timeExpression
public LambdaDslObject timeExpression(java.lang.String name, java.lang.String expression, java.lang.String format)
Attribute whose values are generated from the provided expression- Parameters:
name
- Attribute nameexpression
- Time expressionformat
- Time format to use for values
-
datetimeExpression
public LambdaDslObject datetimeExpression(java.lang.String name, java.lang.String expression)
Attribute whose values are generated from the provided expression. Will use an ISO format.- Parameters:
name
- Attribute nameexpression
- Datetime expression
-
datetimeExpression
public LambdaDslObject datetimeExpression(java.lang.String name, java.lang.String expression, java.lang.String format)
Attribute whose values are generated from the provided expression- Parameters:
name
- Attribute nameexpression
- Datetime expressionformat
- Datetime format to use for values
-
unorderedArray
public LambdaDslObject unorderedArray(java.lang.String name, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field where order is ignored- Parameters:
name
- field name
-
unorderedMinArray
public LambdaDslObject unorderedMinArray(java.lang.String name, int size, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field of min size where order is ignored- Parameters:
name
- field namesize
- minimum size
-
unorderedMaxArray
public LambdaDslObject unorderedMaxArray(java.lang.String name, int size, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field of max size where order is ignored- Parameters:
name
- field namesize
- maximum size
-
unorderedMinMaxArray
public LambdaDslObject unorderedMinMaxArray(java.lang.String name, int minSize, int maxSize, java.util.function.Consumer<LambdaDslJsonArray> nestedArray)
Array field of min and max size where order is ignored- Parameters:
name
- field nameminSize
- minimum sizemaxSize
- maximum size
-
matchUrl
public LambdaDslObject matchUrl(java.lang.String name, java.lang.String basePath, java.lang.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. These can be strings or regular expressions.
-
matchUrl2
public LambdaDslObject matchUrl2(java.lang.String name, java.lang.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. These can be strings or regular expressions.
-
arrayContaining
public LambdaDslObject arrayContaining(java.lang.String name, java.util.function.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
-
-