-
- All Implemented Interfaces:
-
mu.KLoggable
public class Matchers.Companion extends KLogging
-
-
Field Summary
Fields Modifier and Type Field Description private final Long
DATE_2000
private final KLogger
logger
public final static Matchers.Companion
INSTANCE
-
Method Summary
Modifier and Type Method Description final Matcher
regexp(Pattern re, String value)
Match a regular expression final Matcher
regexp(Pattern re)
Match a regular expression final Matcher
regexp(String regexp, String value)
Match a regular expression final Matcher
regexp(String regexp)
Match a regular expression final Matcher
hexValue(String value)
Match a hexadecimal value final Matcher
hexValue()
Match a hexadecimal value final Matcher
identifier(Object value)
Match a numeric identifier (integer) final Matcher
identifier()
Match a numeric identifier (integer) final Matcher
ipAddress(String value)
Match an IP Address final Matcher
ipAddress()
Match an IP Address final Matcher
numeric(Number value)
Match a numeric value final Matcher
numeric()
Match a numeric value final Matcher
decimal(Number value)
Match a decimal value final Matcher
decimal()
Match a decimal value final Matcher
integer(Long value)
Match a integer value final Matcher
integer()
Match a integer value final Matcher
datetime(String pattern, String value)
Match a datetime final Matcher
datetime(String pattern)
Match a datetime final Matcher
datetime()
Match a datetime final Matcher
datetimeExpression(String expression, String pattern)
Match a datetime generated from an expression final Matcher
time(String pattern, String value)
Match a time final Matcher
time(String pattern)
Match a time final Matcher
time()
Match a time final Matcher
timeExpression(String expression, String pattern)
Match a time generated from an expression final Matcher
timeExpression(String expression)
Match a time generated from an expression final Matcher
date(String pattern, String value)
Match a date final Matcher
date(String pattern)
Match a date final Matcher
date()
Match a date final Matcher
dateExpression(String expression, String pattern)
Match a date generated from an expression final Matcher
dateExpression(String expression)
Match a date generated from an expression final Matcher
uuid(String value)
Match a universally unique identifier (UUID) final Matcher
uuid()
Match a universally unique identifier (UUID) final Matcher
string(String value)
Match any string value final Matcher
string()
Match any string value final Matcher
bool(Boolean value)
Match any boolean final Matcher
bool()
Match any boolean final Matcher
eachLike(Integer numberExamples, Object arg)
Array where each element like the following object final Matcher
eachLike(Object arg)
Array where each element like the following object final Matcher
maxLike(Integer max, Integer numberExamples, Object arg)
Array with maximum size and each element like the following object final Matcher
maxLike(Integer max, Object arg)
Array with maximum size and each element like the following object final Matcher
minLike(Integer min, Integer numberExamples, Object arg)
Array with minimum size and each element like the following object final Matcher
minLike(Integer min, Object arg)
Array with minimum size and each element like the following object final Matcher
minMaxLike(Integer min, Integer max, Integer numberExamples, Object arg)
Array with minimum and maximum size and each element like the following object final Matcher
minMaxLike(Integer min, Integer max, Object arg)
Array with minimum and maximum size and each element like the following object final Matcher
equalTo(Object value)
Match Equality final Matcher
includesStr(String value)
Matches if the string is included in the value final Matcher
or(Object example, Object values)
Matches if any of the provided matches match final Matcher
and(Object example, Object values)
Matches if all of the provided matches match final Matcher
nullValue()
Matches a null value final Matcher
url(String basePath, Object pathFragments)
Matches a URL composed of a base path and a list of path fragments final Matcher
eachArrayLike(Integer numberExamples, Object arg)
Array of arrays where each element like the following object final Matcher
eachArrayLike(Object arg)
Array of arrays where each element like the following object final StatusCodeMatcher
informationStatus()
Match any HTTP Information response status (100-199) final StatusCodeMatcher
successStatus()
Match any HTTP success response status (200-299) final StatusCodeMatcher
redirectStatus()
Match any HTTP redirect response status (300-399) final StatusCodeMatcher
clientErrorStatus()
Match any HTTP client error response status (400-499) final StatusCodeMatcher
serverErrorStatus()
Match any HTTP server error response status (500-599) final StatusCodeMatcher
nonErrorStatus()
Match any HTTP non-error response status (< 400) final StatusCodeMatcher
errorStatus()
Match any HTTP error response status (>= 400) final StatusCodeMatcher
statusCodes(List<Integer> statusCodes)
Match any HTTP status code in the provided list final Long
getDATE_2000()
KLogger
getLogger()
-
-
Method Detail
-
regexp
@JvmOverloads() final Matcher regexp(Pattern re, String value)
Match a regular expression
- Parameters:
re
- Regular expression patternvalue
- Example value, if not provided a random one will be generated
-
regexp
@JvmOverloads() final Matcher regexp(Pattern re)
Match a regular expression
- Parameters:
re
- Regular expression pattern
-
regexp
@JvmOverloads() final Matcher regexp(String regexp, String value)
Match a regular expression
- Parameters:
value
- Example value, if not provided a random one will be generated
-
regexp
@JvmOverloads() final Matcher regexp(String regexp)
Match a regular expression
-
hexValue
@JvmOverloads() final Matcher hexValue(String value)
Match a hexadecimal value
- Parameters:
value
- Example value, if not provided a random one will be generated
-
hexValue
@JvmOverloads() final Matcher hexValue()
Match a hexadecimal value
-
identifier
@JvmOverloads() final Matcher identifier(Object value)
Match a numeric identifier (integer)
- Parameters:
value
- Example value, if not provided a random one will be generated
-
identifier
@JvmOverloads() final Matcher identifier()
Match a numeric identifier (integer)
-
ipAddress
@JvmOverloads() final Matcher ipAddress(String value)
Match an IP Address
- Parameters:
value
- Example value, if not provided 127.0.0.
-
ipAddress
@JvmOverloads() final Matcher ipAddress()
Match an IP Address
-
numeric
@JvmOverloads() final Matcher numeric(Number value)
Match a numeric value
- Parameters:
value
- Example value, if not provided a random one will be generated
-
numeric
@JvmOverloads() final Matcher numeric()
Match a numeric value
-
decimal
@JvmOverloads() final Matcher decimal(Number value)
Match a decimal value
- Parameters:
value
- Example value, if not provided a random one will be generated
-
decimal
@JvmOverloads() final Matcher decimal()
Match a decimal value
-
integer
@JvmOverloads() final Matcher integer(Long value)
Match a integer value
- Parameters:
value
- Example value, if not provided a random one will be generated
-
integer
@JvmOverloads() final Matcher integer()
Match a integer value
-
datetime
@JvmOverloads() final Matcher datetime(String pattern, String value)
Match a datetime
- Parameters:
pattern
- Pattern to use to match.value
- Example value, if not provided the current date and time will be used
-
datetime
@JvmOverloads() final Matcher datetime(String pattern)
Match a datetime
- Parameters:
pattern
- Pattern to use to match.
-
datetime
@JvmOverloads() final Matcher datetime()
Match a datetime
-
datetimeExpression
final Matcher datetimeExpression(String expression, String pattern)
Match a datetime generated from an expression
- Parameters:
expression
- Expression to use to generate the datetimepattern
- Pattern to use to match.
-
time
@JvmOverloads() final Matcher time(String pattern, String value)
Match a time
- Parameters:
pattern
- Pattern to use to match.value
- Example value, if not provided the current time will be used
-
time
@JvmOverloads() final Matcher time(String pattern)
Match a time
- Parameters:
pattern
- Pattern to use to match.
-
time
@JvmOverloads() final Matcher time()
Match a time
-
timeExpression
@JvmOverloads() final Matcher timeExpression(String expression, String pattern)
Match a time generated from an expression
- Parameters:
expression
- Expression to use to generate the timepattern
- Pattern to use to match.
-
timeExpression
@JvmOverloads() final Matcher timeExpression(String expression)
Match a time generated from an expression
- Parameters:
expression
- Expression to use to generate the time
-
date
@JvmOverloads() final Matcher date(String pattern, String value)
Match a date
- Parameters:
pattern
- Pattern to use to match.value
- Example value, if not provided the current date will be used
-
date
@JvmOverloads() final Matcher date(String pattern)
Match a date
- Parameters:
pattern
- Pattern to use to match.
-
date
@JvmOverloads() final Matcher date()
Match a date
-
dateExpression
@JvmOverloads() final Matcher dateExpression(String expression, String pattern)
Match a date generated from an expression
- Parameters:
expression
- Expression to use to generate the datepattern
- Pattern to use to match.
-
dateExpression
@JvmOverloads() final Matcher dateExpression(String expression)
Match a date generated from an expression
- Parameters:
expression
- Expression to use to generate the date
-
uuid
@JvmOverloads() final Matcher uuid(String value)
Match a universally unique identifier (UUID)
- Parameters:
value
- optional value to use for examples
-
uuid
@JvmOverloads() final Matcher uuid()
Match a universally unique identifier (UUID)
-
string
@JvmOverloads() final Matcher string(String value)
Match any string value
- Parameters:
value
- Example value, if not provided a random one will be generated
-
string
@JvmOverloads() final Matcher string()
Match any string value
-
bool
@JvmOverloads() final Matcher bool(Boolean value)
Match any boolean
- Parameters:
value
- Example value, if not provided a random one will be generated
-
bool
@JvmOverloads() final Matcher bool()
Match any boolean
-
eachLike
@JvmOverloads() final Matcher eachLike(Integer numberExamples, Object arg)
Array where each element like the following object
- Parameters:
numberExamples
- Optional number of examples to generate.
-
eachLike
@JvmOverloads() final Matcher eachLike(Object arg)
Array where each element like the following object
-
maxLike
@JvmOverloads() final Matcher maxLike(Integer max, Integer numberExamples, Object arg)
Array with maximum size and each element like the following object
- Parameters:
max
- The maximum size of the arraynumberExamples
- Optional number of examples to generate.
-
maxLike
@JvmOverloads() final Matcher maxLike(Integer max, Object arg)
Array with maximum size and each element like the following object
- Parameters:
max
- The maximum size of the array
-
minLike
@JvmOverloads() final Matcher minLike(Integer min, Integer numberExamples, Object arg)
Array with minimum size and each element like the following object
- Parameters:
min
- The minimum size of the arraynumberExamples
- Optional number of examples to generate.
-
minLike
@JvmOverloads() final Matcher minLike(Integer min, Object arg)
Array with minimum size and each element like the following object
- Parameters:
min
- The minimum size of the array
-
minMaxLike
@JvmOverloads() final Matcher minMaxLike(Integer min, Integer max, Integer numberExamples, Object arg)
Array with minimum and maximum size and each element like the following object
- Parameters:
min
- The minimum size of the arraymax
- The maximum size of the arraynumberExamples
- Optional number of examples to generate.
-
minMaxLike
@JvmOverloads() final Matcher minMaxLike(Integer min, Integer max, Object arg)
Array with minimum and maximum size and each element like the following object
- Parameters:
min
- The minimum size of the arraymax
- The maximum size of the array
-
includesStr
final Matcher includesStr(String value)
Matches if the string is included in the value
- Parameters:
value
- String value that must be present
-
or
final Matcher or(Object example, Object values)
Matches if any of the provided matches match
- Parameters:
example
- Example value to use
-
and
final Matcher and(Object example, Object values)
Matches if all of the provided matches match
- Parameters:
example
- Example value to use
-
url
final Matcher url(String basePath, Object pathFragments)
Matches a URL composed of a base path and a list of path fragments
-
eachArrayLike
@JvmOverloads() final Matcher eachArrayLike(Integer numberExamples, Object arg)
Array of arrays where each element like the following object
- Parameters:
numberExamples
- Optional number of examples to generate.
-
eachArrayLike
@JvmOverloads() final Matcher eachArrayLike(Object arg)
Array of arrays where each element like the following object
-
informationStatus
final StatusCodeMatcher informationStatus()
Match any HTTP Information response status (100-199)
-
successStatus
final StatusCodeMatcher successStatus()
Match any HTTP success response status (200-299)
-
redirectStatus
final StatusCodeMatcher redirectStatus()
Match any HTTP redirect response status (300-399)
-
clientErrorStatus
final StatusCodeMatcher clientErrorStatus()
Match any HTTP client error response status (400-499)
-
serverErrorStatus
final StatusCodeMatcher serverErrorStatus()
Match any HTTP server error response status (500-599)
-
nonErrorStatus
final StatusCodeMatcher nonErrorStatus()
Match any HTTP non-error response status (< 400)
-
errorStatus
final StatusCodeMatcher errorStatus()
Match any HTTP error response status (>= 400)
-
statusCodes
final StatusCodeMatcher statusCodes(List<Integer> statusCodes)
Match any HTTP status code in the provided list
-
getDATE_2000
final Long getDATE_2000()
-
getLogger
KLogger getLogger()
-
-
-
-