Package com.xebialabs.restito.semantics
Class Condition
java.lang.Object
com.xebialabs.restito.semantics.Condition
- Direct Known Subclasses:
ConditionWithApplicables
Condition is something that can be true or false given the Call.
Also it contains static factory methods. One should feel free to implement own conditions.
Note, that terms URL and URI have the same meaning as inRequest
.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Condition
Always falsestatic Condition
Always truestatic Condition
If basic authentication is providedboolean
Check if call satisfies the conditionstatic Condition
Joins many conditions with "and" operationstatic Condition
Custom conditionstatic ConditionWithApplicables
Method DELETE with given URIstatic Condition
endsWithUri
(String uri) URI ends withstatic ConditionWithApplicables
Method GET with given URIReturns the predicate of conditionstatic Condition
URI starts withstatic Condition
method
(org.glassfish.grizzly.http.Method m) Checks HTTP methodstatic Condition
Not conditionstatic Condition
Checks HTTP parameters.static ConditionWithApplicables
Method PATCH with given URIstatic ConditionWithApplicables
Method POST with given URIstatic ConditionWithApplicables
Method PUT with given URIstatic Condition
startsWithUri
(String uri) URI starts withstatic Condition
URI exactly equals to the value returned byRequest.getRequestURI()
static Condition
URL exactly equals to the value returned byRequest.getRequestURL()
static Condition
withHeader
(String key) With header present.static Condition
withHeader
(String key, String... expectedHeaders) With header present and equals.static Condition
Contains non-empty POST bodystatic Condition
With POST body containing stringstatic Condition
withPostBodyContaining
(Pattern pattern) With post body matching patternstatic Condition
withPostBodyContainingJsonPath
(String pattern, Object value) With Valid Json Path.
-
Constructor Details
-
Condition
-
-
Method Details
-
getPredicate
Returns the predicate of condition -
check
Check if call satisfies the condition -
method
Checks HTTP method -
parameter
Checks HTTP parameters. Also work with multi-valued parameters -
uri
URI exactly equals to the value returned byRequest.getRequestURI()
-
url
URL exactly equals to the value returned byRequest.getRequestURL()
-
endsWithUri
URI ends with -
startsWithUri
URI starts with -
matchesUri
URI starts with -
withPostBody
Contains non-empty POST body -
basicAuth
If basic authentication is provided -
custom
Custom condition -
not
Not condition -
withPostBodyContaining
With POST body containing string -
withPostBodyContaining
With post body matching pattern -
withPostBodyContainingJsonPath
With Valid Json Path. Check to see if incoming path has a valid string value selected via a JSONPath expression. -
withHeader
With header present. Header key is case insensitive. More information here. -
withHeader
With header present and equals. Header key is case insensitive. More information here. -
get
Method GET with given URI -
post
Method POST with given URI -
put
Method PUT with given URI -
delete
Method DELETE with given URI -
patch
Method PATCH with given URI -
alwaysTrue
Always true -
alwaysFalse
Always false -
composite
Joins many conditions with "and" operation
-