-
public class PactDslJsonRootValue.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static PactDslJsonRootValue.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final PactDslJsonRootValuestringType()Value that can be any string final PactDslJsonRootValuestringType(String example)Value that can be any string final PactDslJsonRootValuenumberType()Value that can be any number final PactDslJsonRootValuenumberType(Number number)Value that can be any number final PactDslJsonRootValueintegerType()Value that must be an integer final PactDslJsonRootValueintegerType(Long number)Value that must be an integer final PactDslJsonRootValueintegerType(Integer number)Value that must be an integer final PactDslJsonRootValuedecimalType()Value that must be a decimal value final PactDslJsonRootValuedecimalType(BigDecimal number)Value that must be a decimalType value final PactDslJsonRootValuedecimalType(Double number)Value that must be a decimalType value final PactDslJsonRootValuebooleanType(Boolean example)Value that must be a boolean final PactDslJsonRootValuebooleanType()Value that must be a boolean final PactDslJsonRootValuestringMatcher(String regex, String value)Value that must match the regular expression final PactDslJsonRootValuestringMatcher(String regex)Value that must match the regular expression final PactDslJsonRootValuetimestamp(String format)Value that must match the given timestamp format final PactDslJsonRootValuetimestamp()Value that must match the given timestamp format final PactDslJsonRootValuetimestamp(String format, Date example)Value that must match the given timestamp format final PactDslJsonRootValuedatetime(String format)Value that must match the given timestamp format final PactDslJsonRootValuedatetime()Value that must match the given timestamp format final PactDslJsonRootValuedatetime(String format, Date example)Value that must match the given timestamp format final PactDslJsonRootValuedate(String format)Value that must match the provided date format final PactDslJsonRootValuedate()Value that must match the provided date format final PactDslJsonRootValuedate(String format, Date example)Value that must match the provided date format final PactDslJsonRootValuetime(String format)Value that must match the given time format final PactDslJsonRootValuetime()Value that must match the given time format final PactDslJsonRootValuetime(String format, Date example)Value that must match the given time format final PactDslJsonRootValueipAddress()Value that must be an IP4 address final PactDslJsonRootValueid()Value that must be a numeric identifier final PactDslJsonRootValueid(Long id)Value that must be a numeric identifier final PactDslJsonRootValuehexValue()Value that must be encoded as a hexadecimal value final PactDslJsonRootValuehexValue(String hexValue)Value that must be encoded as a hexadecimal value final PactDslJsonRootValueuuid()Value that must be encoded as an UUID final PactDslJsonRootValueuuid(UUID uuid)Value that must be encoded as an UUID final PactDslJsonRootValueuuid(String uuid)Value that must be encoded as an UUID final PactDslJsonRootValueand(Object example, MatchingRule rules)Combine all the matchers using AND final PactDslJsonRootValueor(Object example, MatchingRule rules)Combine all the matchers using OR final PactDslJsonRootValuevalueFromProviderState(String expression, Object example)Adds a value that will have it's value injected from the provider state final PactDslJsonRootValuedateExpression(String expression, String format)Date value generated from an expression. final PactDslJsonRootValuedateExpression(String expression)Date value generated from an expression. final PactDslJsonRootValuetimeExpression(String expression, String format)Time value generated from an expression. final PactDslJsonRootValuetimeExpression(String expression)Time value generated from an expression. final PactDslJsonRootValuedatetimeExpression(String expression, String format)Datetime value generated from an expression. final PactDslJsonRootValuedatetimeExpression(String expression)Datetime value generated from an expression. -
-
Method Detail
-
stringType
final PactDslJsonRootValue stringType()
Value that can be any string
-
stringType
final PactDslJsonRootValue stringType(String example)
Value that can be any string
- Parameters:
example- example value to use for generated bodies
-
numberType
final PactDslJsonRootValue numberType()
Value that can be any number
-
numberType
final PactDslJsonRootValue numberType(Number number)
Value that can be any number
- Parameters:
number- example number to use for generated bodies
-
integerType
final PactDslJsonRootValue integerType()
Value that must be an integer
-
integerType
final PactDslJsonRootValue integerType(Long number)
Value that must be an integer
- Parameters:
number- example integer value to use for generated bodies
-
integerType
final PactDslJsonRootValue integerType(Integer number)
Value that must be an integer
- Parameters:
number- example integer value to use for generated bodies
-
decimalType
final PactDslJsonRootValue decimalType()
Value that must be a decimal value
-
decimalType
final PactDslJsonRootValue decimalType(BigDecimal number)
Value that must be a decimalType value
- Parameters:
number- example decimalType value
-
decimalType
final PactDslJsonRootValue decimalType(Double number)
Value that must be a decimalType value
- Parameters:
number- example decimalType value
-
booleanType
@JvmOverloads() final PactDslJsonRootValue booleanType(Boolean example)
Value that must be a boolean
- Parameters:
example- example boolean to use for generated bodies
-
booleanType
@JvmOverloads() final PactDslJsonRootValue booleanType()
Value that must be a boolean
-
stringMatcher
final PactDslJsonRootValue stringMatcher(String regex, String value)
Value that must match the regular expression
- Parameters:
regex- regular expressionvalue- example value to use for generated bodies
-
stringMatcher
@Deprecated(message = Use the version that takes an example value) final PactDslJsonRootValue stringMatcher(String regex)
Value that must match the regular expression
- Parameters:
regex- regular expression
-
timestamp
@JvmOverloads()@Deprecated(message = use datetime) final PactDslJsonRootValue timestamp(String format)
Value that must match the given timestamp format
- Parameters:
format- timestamp format
-
timestamp
@JvmOverloads()@Deprecated(message = use datetime) final PactDslJsonRootValue timestamp()
Value that must match the given timestamp format
-
timestamp
@Deprecated(message = use datetime) final PactDslJsonRootValue timestamp(String format, Date example)
Value that must match the given timestamp format
- Parameters:
format- timestamp formatexample- example date and time to use for generated bodies
-
datetime
@JvmOverloads() final PactDslJsonRootValue datetime(String format)
Value that must match the given timestamp format
- Parameters:
format- timestamp format
-
datetime
@JvmOverloads() final PactDslJsonRootValue datetime()
Value that must match the given timestamp format
-
datetime
final PactDslJsonRootValue datetime(String format, Date example)
Value that must match the given timestamp format
- Parameters:
format- timestamp formatexample- example date and time to use for generated bodies
-
date
@JvmOverloads() final PactDslJsonRootValue date(String format)
Value that must match the provided date format
- Parameters:
format- date format to match
-
date
@JvmOverloads() final PactDslJsonRootValue date()
Value that must match the provided date format
-
date
final PactDslJsonRootValue date(String format, Date example)
Value that must match the provided date format
- Parameters:
format- date format to matchexample- example date to use for generated values
-
time
@JvmOverloads() final PactDslJsonRootValue time(String format)
Value that must match the given time format
- Parameters:
format- time format to match
-
time
@JvmOverloads() final PactDslJsonRootValue time()
Value that must match the given time format
-
time
final PactDslJsonRootValue time(String format, Date example)
Value that must match the given time format
- Parameters:
format- time format to matchexample- example time to use for generated bodies
-
ipAddress
final PactDslJsonRootValue ipAddress()
Value that must be an IP4 address
-
id
final PactDslJsonRootValue id()
Value that must be a numeric identifier
-
id
final PactDslJsonRootValue id(Long id)
Value that must be a numeric identifier
- Parameters:
id- example id to use for generated bodies
-
hexValue
final PactDslJsonRootValue hexValue()
Value that must be encoded as a hexadecimal value
-
hexValue
final PactDslJsonRootValue hexValue(String hexValue)
Value that must be encoded as a hexadecimal value
- Parameters:
hexValue- example value to use for generated bodies
-
uuid
final PactDslJsonRootValue uuid()
Value that must be encoded as an UUID
-
uuid
final PactDslJsonRootValue uuid(UUID uuid)
Value that must be encoded as an UUID
- Parameters:
uuid- example UUID to use for generated bodies
-
uuid
final PactDslJsonRootValue uuid(String uuid)
Value that must be encoded as an UUID
- Parameters:
uuid- example UUID to use for generated bodies
-
and
final PactDslJsonRootValue and(Object example, MatchingRule rules)
Combine all the matchers using AND
- Parameters:
example- Attribute example valuerules- Matching rules to apply
-
or
final PactDslJsonRootValue or(Object example, MatchingRule rules)
Combine all the matchers using OR
- Parameters:
example- Attribute namerules- Matching rules to apply
-
valueFromProviderState
final PactDslJsonRootValue valueFromProviderState(String expression, Object example)
Adds a value that will have it's value injected from the provider state
- Parameters:
expression- Expression to be evaluated from the provider stateexample- Example value to be used in the consumer test
-
dateExpression
@JvmOverloads() final PactDslJsonRootValue dateExpression(String expression, String format)
Date value generated from an expression.
- Parameters:
expression- Date expressionformat- Date format to use
-
dateExpression
@JvmOverloads() final PactDslJsonRootValue dateExpression(String expression)
Date value generated from an expression.
- Parameters:
expression- Date expression
-
timeExpression
@JvmOverloads() final PactDslJsonRootValue timeExpression(String expression, String format)
Time value generated from an expression.
- Parameters:
expression- Time expressionformat- Time format to use
-
timeExpression
@JvmOverloads() final PactDslJsonRootValue timeExpression(String expression)
Time value generated from an expression.
- Parameters:
expression- Time expression
-
datetimeExpression
@JvmOverloads() final PactDslJsonRootValue datetimeExpression(String expression, String format)
Datetime value generated from an expression.
- Parameters:
expression- Datetime expressionformat- Datetime format to use
-
datetimeExpression
@JvmOverloads() final PactDslJsonRootValue datetimeExpression(String expression)
Datetime value generated from an expression.
- Parameters:
expression- Datetime expression
-
-
-
-