-
public class PactDslRootValue.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static PactDslRootValue.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final PactDslRootValuestringType()Value that can be any string final PactDslRootValuestringType(String example)Value that can be any string final PactDslRootValuenumberType()Value that can be any number final PactDslRootValuenumberType(Number number)Value that can be any number final PactDslRootValueintegerType()Value that must be an integer final PactDslRootValueintegerType(Long number)Value that must be an integer final PactDslRootValueintegerType(Integer number)Value that must be an integer final PactDslRootValuedecimalType()Value that must be a decimal value final PactDslRootValuedecimalType(BigDecimal number)Value that must be a decimalType value final PactDslRootValuedecimalType(Double number)Value that must be a decimalType value final PactDslRootValuebooleanType(Boolean example)Value that must be a boolean final PactDslRootValuebooleanType()Value that must be a boolean final PactDslRootValuestringMatcher(String regex, String value)Value that must match the regular expression final PactDslRootValuetimestamp(String format)Value that must match the given timestamp format final PactDslRootValuetimestamp()Value that must match the given timestamp format final PactDslRootValuetimestamp(String format, Date example)Value that must match the given timestamp format final PactDslRootValuedate(String format)Value that must match the provided date format final PactDslRootValuedate()Value that must match the provided date format final PactDslRootValuedate(String format, Date example)Value that must match the provided date format final PactDslRootValuetime(String format)Value that must match the given time format final PactDslRootValuetime()Value that must match the given time format final PactDslRootValuetime(String format, Date example)Value that must match the given time format final PactDslRootValueipAddress()Value that must be an IP4 address final PactDslRootValueid()Value that must be a numeric identifier final PactDslRootValueid(Long id)Value that must be a numeric identifier final PactDslRootValuehexValue()Value that must be encoded as a hexadecimal value final PactDslRootValuehexValue(String hexValue)Value that must be encoded as a hexadecimal value final PactDslRootValueuuid()Value that must be encoded as an UUID final PactDslRootValueuuid(UUID uuid)Value that must be encoded as an UUID final PactDslRootValueuuid(String uuid)Value that must be encoded as an UUID final PactDslRootValueand(Object example, MatchingRule rules)Combine all the matchers using AND final PactDslRootValueor(Object example, MatchingRule rules)Combine all the matchers using OR final PactDslRootValuevalueFromProviderState(String expression, Object example)Adds a value that will have it's value injected from the provider state -
-
Method Detail
-
stringType
final PactDslRootValue stringType()
Value that can be any string
-
stringType
final PactDslRootValue stringType(String example)
Value that can be any string
- Parameters:
example- example value to use for generated bodies
-
numberType
final PactDslRootValue numberType()
Value that can be any number
-
numberType
final PactDslRootValue numberType(Number number)
Value that can be any number
- Parameters:
number- example number to use for generated bodies
-
integerType
final PactDslRootValue integerType()
Value that must be an integer
-
integerType
final PactDslRootValue integerType(Long number)
Value that must be an integer
- Parameters:
number- example integer value to use for generated bodies
-
integerType
final PactDslRootValue integerType(Integer number)
Value that must be an integer
- Parameters:
number- example integer value to use for generated bodies
-
decimalType
final PactDslRootValue decimalType()
Value that must be a decimal value
-
decimalType
final PactDslRootValue decimalType(BigDecimal number)
Value that must be a decimalType value
- Parameters:
number- example decimalType value
-
decimalType
final PactDslRootValue decimalType(Double number)
Value that must be a decimalType value
- Parameters:
number- example decimalType value
-
booleanType
@JvmOverloads() final PactDslRootValue booleanType(Boolean example)
Value that must be a boolean
- Parameters:
example- example boolean to use for generated bodies
-
booleanType
@JvmOverloads() final PactDslRootValue booleanType()
Value that must be a boolean
-
stringMatcher
final PactDslRootValue stringMatcher(String regex, String value)
Value that must match the regular expression
- Parameters:
regex- regular expressionvalue- example value to use for generated bodies
-
timestamp
@JvmOverloads() final PactDslRootValue timestamp(String format)
Value that must match the given timestamp format
- Parameters:
format- timestamp format
-
timestamp
@JvmOverloads() final PactDslRootValue timestamp()
Value that must match the given timestamp format
-
timestamp
final PactDslRootValue 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
-
date
@JvmOverloads() final PactDslRootValue date(String format)
Value that must match the provided date format
- Parameters:
format- date format to match
-
date
@JvmOverloads() final PactDslRootValue date()
Value that must match the provided date format
-
date
final PactDslRootValue 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 PactDslRootValue time(String format)
Value that must match the given time format
- Parameters:
format- time format to match
-
time
@JvmOverloads() final PactDslRootValue time()
Value that must match the given time format
-
time
final PactDslRootValue 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 PactDslRootValue ipAddress()
Value that must be an IP4 address
-
id
final PactDslRootValue id()
Value that must be a numeric identifier
-
id
final PactDslRootValue id(Long id)
Value that must be a numeric identifier
- Parameters:
id- example id to use for generated bodies
-
hexValue
final PactDslRootValue hexValue()
Value that must be encoded as a hexadecimal value
-
hexValue
final PactDslRootValue hexValue(String hexValue)
Value that must be encoded as a hexadecimal value
- Parameters:
hexValue- example value to use for generated bodies
-
uuid
final PactDslRootValue uuid()
Value that must be encoded as an UUID
-
uuid
final PactDslRootValue uuid(UUID uuid)
Value that must be encoded as an UUID
- Parameters:
uuid- example UUID to use for generated bodies
-
uuid
final PactDslRootValue uuid(String uuid)
Value that must be encoded as an UUID
- Parameters:
uuid- example UUID to use for generated bodies
-
and
final PactDslRootValue and(Object example, MatchingRule rules)
Combine all the matchers using AND
- Parameters:
example- Attribute example valuerules- Matching rules to apply
-
or
final PactDslRootValue or(Object example, MatchingRule rules)
Combine all the matchers using OR
- Parameters:
example- Attribute namerules- Matching rules to apply
-
valueFromProviderState
final PactDslRootValue 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
-
-
-
-