Package org.grpcmock.definitions.matcher
Class RequestMatcherBuilderImpl<ReqT>
java.lang.Object
org.grpcmock.definitions.matcher.RequestMatcherBuilderImpl<ReqT>
- All Implemented Interfaces:
BuilderStep,RequestMatcherBuilderStep<RequestMatcherBuilderImpl<ReqT>,,ReqT> StreamRequestMatcherBuilderStep<RequestMatcherBuilderImpl<ReqT>,ReqT>
public class RequestMatcherBuilderImpl<ReqT>
extends Object
implements RequestMatcherBuilderStep<RequestMatcherBuilderImpl<ReqT>,ReqT>, StreamRequestMatcherBuilderStep<RequestMatcherBuilderImpl<ReqT>,ReqT>
- Author:
- Fadelis
-
Method Summary
Modifier and TypeMethodDescriptionbuild()voidwithRequest(Predicate<ReqT> requestPredicate) Adds a request matcher for the stub, which will trigger only if incoming request satisfies givenPredicate.withRequests(Predicate<List<ReqT>> requestsPredicate) Adds a requests' matcher, which checks if all received stream requests satisfies givenPredicate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.grpcmock.definitions.matcher.steps.RequestMatcherBuilderStep
withRequestMethods inherited from interface org.grpcmock.definitions.matcher.steps.StreamRequestMatcherBuilderStep
withFirstRequest, withFirstRequest, withNumberOfRequests, withRequestAtIndex, withRequestAtIndex, withRequests, withRequests, withRequestsContaining, withRequestsContaining
-
Method Details
-
withRequest
Description copied from interface:RequestMatcherBuilderStepAdds a request matcher for the stub, which will trigger only if incoming request satisfies given
Predicate.Only applicable to unary or server streaming methods.
Subsequent request matchers will replace the old one.
- Specified by:
withRequestin interfaceRequestMatcherBuilderStep<RequestMatcherBuilderImpl<ReqT>,ReqT>
-
withRequests
public RequestMatcherBuilderImpl<ReqT> withRequests(@Nonnull Predicate<List<ReqT>> requestsPredicate) Description copied from interface:StreamRequestMatcherBuilderStepAdds a requests' matcher, which checks if all received stream requests satisfies given
Predicate.Only applicable to client and bidi streaming methods.
Subsequent requests matchers will be added as additional conditions.
- Specified by:
withRequestsin interfaceStreamRequestMatcherBuilderStep<RequestMatcherBuilderImpl<ReqT>,ReqT>
-
clearRequestsPredicates
public void clearRequestsPredicates() -
build
-