Uses of Enum
com.shri.restinpeace.constant.HTTPMethod
Packages that use HTTPMethod
Package
Description
-
Uses of HTTPMethod in com.shri.restinpeace.cache
Methods in com.shri.restinpeace.cache with parameters of type HTTPMethodModifier and TypeMethodDescriptionstatic StringCache.key(HTTPMethod httpMethod, String url) Computes the cache key RIP itself uses internally for a call tourl- the same formulaget/put/evictare keyed by for that exact call, so this is the value to pass toCache.evict(java.lang.String)to manually invalidate one specific cached response. -
Uses of HTTPMethod in com.shri.restinpeace.constant
Methods in com.shri.restinpeace.constant that return HTTPMethodModifier and TypeMethodDescriptionstatic HTTPMethodReturns the enum constant of this type with the specified name.static HTTPMethod[]HTTPMethod.values()Returns an array containing the constants of this enum type, in the order they are declared. -
Uses of HTTPMethod in com.shri.restinpeace.interceptor
Methods in com.shri.restinpeace.interceptor that return HTTPMethodModifier and TypeMethodDescriptionRequestContext.getHttpMethod()Returns the HTTP method of the request being made.Constructors in com.shri.restinpeace.interceptor with parameters of type HTTPMethodModifierConstructorDescriptionRequestContext(HTTPMethod httpMethod, String url) Creates the context for a single call. -
Uses of HTTPMethod in com.shri.restinpeace.internal
Methods in com.shri.restinpeace.internal with parameters of type HTTPMethodModifier and TypeMethodDescriptionkong.unirest.HttpRequest<?>RequestExecutor.createGeneratedRequest(HTTPMethod httpMethod, String url, int connectMillis, int readMillis) Builds the request and applies its@Timeout(if any) - the generated-code counterpart ofRequestExecutor.createRequest(HTTPMethod, String)plusRequestExecutor.applyTimeout(HttpRequest, Method), taking@Timeout's values as literals (or-1, its own "unset" default, for a method with none) instead of a reflective lookup.RequestExecutor.processRestRequest(Method method, HTTPMethod httpMethod, Object[] args) Executes the given@RestClientmethod call and returns its result. -
Uses of HTTPMethod in com.shri.restinpeace.mock
Methods in com.shri.restinpeace.mock that return HTTPMethodModifier and TypeMethodDescriptionRecordedRequest.getHttpMethod()Returns the HTTP method of the request.Methods in com.shri.restinpeace.mock with parameters of type HTTPMethodModifier and TypeMethodDescriptionintMockRestServer.countOf(HTTPMethod httpMethod, String pathTemplate) Returns how many recorded requests matchhttpMethodandpathTemplate- a check for "was this endpoint called, and how many times" without manually filteringMockRestServer.getRecordedRequests()or looping overMockRestServer.takeRequest().MockRestServer.enqueueFor(HTTPMethod httpMethod, String pathTemplate, MockResponse response) Scripts a one-time response for a route already registered viaMockRestServer.on(HTTPMethod, String, MockResponse), consumed - in the order queued - before that route's sticky response, the way to combine a scripted failure sequence with a sticky final answer for the same path (e.g. a503then a200, to prove@Retryrecovers, while every request after that still gets the200the route was registered with).MockRestServer.enqueueFor(HTTPMethod httpMethod, String pathTemplate, Map<String, String> requiredQueryParams, MockResponse response) Same asMockRestServer.enqueueFor(HTTPMethod, String, MockResponse), for a route registered viaMockRestServer.on(HTTPMethod, String, Map, MockResponse)with the samerequiredQueryParams.MockRestServer.on(HTTPMethod httpMethod, String pathTemplate, MockResponse response) Registers a response for every request matchinghttpMethodandpathTemplate- unlikeMockRestServer.enqueue(com.shri.restinpeace.mock.MockResponse), this doesn't get consumed; it keeps answering every matching request the same way.MockRestServer.on(HTTPMethod httpMethod, String pathTemplate, Predicate<RecordedRequest> matcher, MockResponse response) Same asMockRestServer.on(HTTPMethod, String, MockResponse), but only matches a request for whichmatcheralso returnstrue- for matching on a request header or the request body, neither of which therequiredQueryParamsoverload covers, e.g.MockRestServer.on(HTTPMethod httpMethod, String pathTemplate, Map<String, String> requiredQueryParams, MockResponse response) Same asMockRestServer.on(HTTPMethod, String, MockResponse), but only matches a request whose query params contain every entry inrequiredQueryParamswith an equal value - any other query params the request carries are ignored.MockRestServer.onFlaky(HTTPMethod httpMethod, String pathTemplate, int failuresBeforeSuccess, MockResponse failureResponse, MockResponse successResponse) Registers a route that failsfailuresBeforeSuccesstimes withfailureResponsebefore settling intosuccessResponsefor every request after that - sugar for callingMockRestServer.on(HTTPMethod, String, MockResponse)withsuccessResponseand thenMockRestServer.enqueueFor(com.shri.restinpeace.constant.HTTPMethod, java.lang.String, com.shri.restinpeace.mock.MockResponse)withfailureResponsefailuresBeforeSuccesstimes.MockRestServer.onPages(HTTPMethod httpMethod, String pathTemplate, MockResponse... responses) Scripts an ordered sequence of responses for a route - the 1st matching request getsresponses[0], the 2nd getsresponses[1], and so on, with the last response answering every request after the sequence is exhausted.MockRestServer.onPages(HTTPMethod httpMethod, String pathTemplate, Map<String, String> requiredQueryParams, MockResponse... responses) Same asMockRestServer.onPages(HTTPMethod, String, MockResponse...), but only matches a request whose query params contain every entry inrequiredQueryParams- for a path also serving other, non-paginated traffic that a bareMockRestServer.onPages(HTTPMethod, String, MockResponse...)route would otherwise intercept too.booleanMockRestServer.remove(HTTPMethod httpMethod, String pathTemplate) Removes a route registered viaMockRestServer.on(HTTPMethod, String, MockResponse), so a later request to that path falls through to any other registered route, theMockRestServer.enqueue(com.shri.restinpeace.mock.MockResponse)queue, or the default "no response was queued or registered" failure - without a fullMockRestServer.reset(), which would also wipe every other route, the queue, and recorded-request history.booleanMockRestServer.remove(HTTPMethod httpMethod, String pathTemplate, Map<String, String> requiredQueryParams) Same asMockRestServer.remove(HTTPMethod, String), for a route registered viaMockRestServer.on(HTTPMethod, String, Map, MockResponse)with the samerequiredQueryParams.