Class Matchers
-
- All Implemented Interfaces:
public class MatchersBase class for DSL matcher methods
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMatchers.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static Matchers.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description Matchers()
-
Method Summary
Modifier and Type Method Description final static Matcherregexp(Pattern re, String value)Match a regular expression final static Matcherregexp(Pattern re)Match a regular expression final static Matcherregexp(String regexp, String value)Match a regular expression final static Matcherregexp(String regexp)Match a regular expression final static MatcherhexValue(String value)Match a hexadecimal value final static MatcherhexValue()Match a hexadecimal value final static Matcheridentifier(Object value)Match a numeric identifier (integer) final static Matcheridentifier()Match a numeric identifier (integer) final static MatcheripAddress(String value)Match an IP Address final static MatcheripAddress()Match an IP Address final static Matchernumeric(Number value)Match a numeric value final static Matchernumeric()Match a numeric value final static Matcherdecimal(Number value)Match a decimal value final static Matcherdecimal()Match a decimal value final static Matcherinteger(Long value)Match a integer value final static Matcherinteger()Match a integer value final static Matcherdatetime(String pattern, String value)Match a datetime final static Matcherdatetime(String pattern)Match a datetime final static Matcherdatetime()Match a datetime final static Matchertime(String pattern, String value)Match a time final static Matchertime(String pattern)Match a time final static Matchertime()Match a time final static MatchertimeExpression(String expression, String pattern)Match a time generated from an expression final static MatchertimeExpression(String expression)Match a time generated from an expression final static Matcherdate(String pattern, String value)Match a date final static Matcherdate(String pattern)Match a date final static Matcherdate()Match a date final static MatcherdateExpression(String expression, String pattern)Match a date generated from an expression final static MatcherdateExpression(String expression)Match a date generated from an expression final static Matcheruuid(String value)Match a universally unique identifier (UUID) final static Matcheruuid()Match a universally unique identifier (UUID) final static Matcherstring(String value)Match any string value final static Matcherstring()Match any string value final static Matcherbool(Boolean value)Match any boolean final static Matcherbool()Match any boolean final static MatchereachLike(Integer numberExamples, Object arg)Array where each element like the following object final static MatchereachLike(Object arg)Array where each element like the following object final static MatchermaxLike(Integer max, Integer numberExamples, Object arg)Array with maximum size and each element like the following object final static MatchermaxLike(Integer max, Object arg)Array with maximum size and each element like the following object final static MatcherminLike(Integer min, Integer numberExamples, Object arg)Array with minimum size and each element like the following object final static MatcherminLike(Integer min, Object arg)Array with minimum size and each element like the following object final static MatcherminMaxLike(Integer min, Integer max, Integer numberExamples, Object arg)Array with minimum and maximum size and each element like the following object final static MatcherminMaxLike(Integer min, Integer max, Object arg)Array with minimum and maximum size and each element like the following object final static MatcherequalTo(Object value)Match Equality final static MatcherincludesStr(String value)Matches if the string is included in the value final static Matcheror(Object example, Object values)Matches if any of the provided matches match final static Matcherand(Object example, Object values)Matches if all of the provided matches match final static MatchernullValue()Matches a null value final static Matcherurl(String basePath, Object pathFragments)Matches a URL composed of a base path and a list of path fragments final static MatchereachArrayLike(Integer numberExamples, Object arg)Array of arrays where each element like the following object final static MatchereachArrayLike(Object arg)Array of arrays where each element like the following object final static StatusCodeMatcherinformationStatus()Match any HTTP Information response status (100-199) final static StatusCodeMatchersuccessStatus()Match any HTTP success response status (200-299) final static StatusCodeMatcherredirectStatus()Match any HTTP redirect response status (300-399) final static StatusCodeMatcherclientErrorStatus()Match any HTTP client error response status (400-499) final static StatusCodeMatcherserverErrorStatus()Match any HTTP server error response status (500-599) final static StatusCodeMatchernonErrorStatus()Match any HTTP non-error response status (< 400) final static StatusCodeMatchererrorStatus()Match any HTTP error response status (>= 400) final static StatusCodeMatcherstatusCodes(List<Integer> statusCodes)Match any HTTP status code in the provided list -
-
Method Detail
-
regexp
@JvmOverloads() final static 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 static Matcher regexp(Pattern re)
Match a regular expression
- Parameters:
re- Regular expression pattern
-
regexp
@JvmOverloads() final static 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 static Matcher regexp(String regexp)
Match a regular expression
-
hexValue
@JvmOverloads() final static Matcher hexValue(String value)
Match a hexadecimal value
- Parameters:
value- Example value, if not provided a random one will be generated
-
hexValue
@JvmOverloads() final static Matcher hexValue()
Match a hexadecimal value
-
identifier
@JvmOverloads() final static 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 static Matcher identifier()
Match a numeric identifier (integer)
-
ipAddress
@JvmOverloads() final static Matcher ipAddress(String value)
Match an IP Address
- Parameters:
value- Example value, if not provided 127.0.0.
-
ipAddress
@JvmOverloads() final static Matcher ipAddress()
Match an IP Address
-
numeric
@JvmOverloads() final static Matcher numeric(Number value)
Match a numeric value
- Parameters:
value- Example value, if not provided a random one will be generated
-
numeric
@JvmOverloads() final static Matcher numeric()
Match a numeric value
-
decimal
@JvmOverloads() final static Matcher decimal(Number value)
Match a decimal value
- Parameters:
value- Example value, if not provided a random one will be generated
-
decimal
@JvmOverloads() final static Matcher decimal()
Match a decimal value
-
integer
@JvmOverloads() final static Matcher integer(Long value)
Match a integer value
- Parameters:
value- Example value, if not provided a random one will be generated
-
integer
@JvmOverloads() final static Matcher integer()
Match a integer value
-
datetime
@JvmOverloads() final static 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 static Matcher datetime(String pattern)
Match a datetime
- Parameters:
pattern- Pattern to use to match.
-
datetime
@JvmOverloads() final static Matcher datetime()
Match a datetime
-
time
@JvmOverloads() final static 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 static Matcher time(String pattern)
Match a time
- Parameters:
pattern- Pattern to use to match.
-
time
@JvmOverloads() final static Matcher time()
Match a time
-
timeExpression
@JvmOverloads() final static 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 static Matcher timeExpression(String expression)
Match a time generated from an expression
- Parameters:
expression- Expression to use to generate the time
-
date
@JvmOverloads() final static 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 static Matcher date(String pattern)
Match a date
- Parameters:
pattern- Pattern to use to match.
-
date
@JvmOverloads() final static Matcher date()
Match a date
-
dateExpression
@JvmOverloads() final static 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 static Matcher dateExpression(String expression)
Match a date generated from an expression
- Parameters:
expression- Expression to use to generate the date
-
uuid
@JvmOverloads() final static Matcher uuid(String value)
Match a universally unique identifier (UUID)
- Parameters:
value- optional value to use for examples
-
uuid
@JvmOverloads() final static Matcher uuid()
Match a universally unique identifier (UUID)
-
string
@JvmOverloads() final static Matcher string(String value)
Match any string value
- Parameters:
value- Example value, if not provided a random one will be generated
-
string
@JvmOverloads() final static Matcher string()
Match any string value
-
bool
@JvmOverloads() final static Matcher bool(Boolean value)
Match any boolean
- Parameters:
value- Example value, if not provided a random one will be generated
-
bool
@JvmOverloads() final static Matcher bool()
Match any boolean
-
eachLike
@JvmOverloads() final static 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 static Matcher eachLike(Object arg)
Array where each element like the following object
-
maxLike
@JvmOverloads() final static 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 static 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 static 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 static 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 static 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 static 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
-
equalTo
final static Matcher equalTo(Object value)
Match Equality
- Parameters:
value- Value to match to
-
includesStr
final static Matcher includesStr(String value)
Matches if the string is included in the value
- Parameters:
value- String value that must be present
-
or
final static Matcher or(Object example, Object values)
Matches if any of the provided matches match
- Parameters:
example- Example value to use
-
and
final static Matcher and(Object example, Object values)
Matches if all of the provided matches match
- Parameters:
example- Example value to use
-
url
final static Matcher url(String basePath, Object pathFragments)
Matches a URL composed of a base path and a list of path fragments
-
eachArrayLike
@JvmOverloads() final static 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 static Matcher eachArrayLike(Object arg)
Array of arrays where each element like the following object
-
informationStatus
final static StatusCodeMatcher informationStatus()
Match any HTTP Information response status (100-199)
-
successStatus
final static StatusCodeMatcher successStatus()
Match any HTTP success response status (200-299)
-
redirectStatus
final static StatusCodeMatcher redirectStatus()
Match any HTTP redirect response status (300-399)
-
clientErrorStatus
final static StatusCodeMatcher clientErrorStatus()
Match any HTTP client error response status (400-499)
-
serverErrorStatus
final static StatusCodeMatcher serverErrorStatus()
Match any HTTP server error response status (500-599)
-
nonErrorStatus
final static StatusCodeMatcher nonErrorStatus()
Match any HTTP non-error response status (< 400)
-
errorStatus
final static StatusCodeMatcher errorStatus()
Match any HTTP error response status (>= 400)
-
statusCodes
final static StatusCodeMatcher statusCodes(List<Integer> statusCodes)
Match any HTTP status code in the provided list
-
-
-
-