Package com.mx.path.testing.request
Class RequestMatcher
java.lang.Object
com.mx.path.testing.request.RequestMatcher
Allows rules to be defined for matching incoming requests
Examples:
# Matches any request where request.getPath() == "account"
RequestMatcher.withPath("accounts")
# Matches any request where request.getPath() == "accounts"
# AND request.getMethod() == "GET"
RequestMatcher.withPath("accounts").withMethod("GET")
# Matches any request where request.equals(exactMatchRequest)
RequestMatcher.withPath(exactMatchRequest)
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Stringdescribe()final RequestMatcherexactly(com.mx.path.core.common.connect.Request<?, ?> exactRequest) final booleanisMatch(com.mx.path.core.common.connect.Request<?, ?> request) final RequestMatcherfinal RequestMatcherwithBaseUrl(String baseUrl) final RequestMatcherwithMatcher(Function<com.mx.path.core.common.connect.Request<?, ?>, Boolean> check) final RequestMatcherwithMethod(String method) final RequestMatcher
-
Constructor Details
-
RequestMatcher
public RequestMatcher()
-
-
Method Details
-
isMatch
public final boolean isMatch(com.mx.path.core.common.connect.Request<?, ?> request) -
withBaseUrl
-
withMethod
-
withPath
-
with
public final RequestMatcher with(Function<com.mx.path.core.common.connect.Request<?, ?>, Boolean> check) -
withMatcher
public final RequestMatcher withMatcher(Function<com.mx.path.core.common.connect.Request<?, ?>, Boolean> check) -
exactly
-
describe
-