public class RequestPatternBuilderImpl<ReqT> extends Object implements RequestPatternBuilderStep<ReqT>
RequestPattern to define conditions for CapturedRequest matching.| Constructor and Description |
|---|
RequestPatternBuilderImpl(io.grpc.MethodDescriptor<ReqT,?> method) |
| Modifier and Type | Method and Description |
|---|---|
RequestPattern<ReqT> |
build()
Builds a
RequestPattern with given configuration. |
void |
clearRequestsPredicates() |
<T> RequestPatternBuilderImpl<ReqT> |
withHeader(io.grpc.Metadata.Key<T> headerKey,
Predicate<T> predicate)
Adds a header matcher for the stub, which will trigger only if the given header
has value satisfying given
Predicate. |
RequestPatternBuilderImpl<ReqT> |
withRequest(Predicate<ReqT> requestPredicate)
Adds a request matcher for the stub, which will trigger only if incoming request
satisfies given
Predicate. |
RequestPatternBuilderStep<ReqT> |
withRequests(Predicate<List<ReqT>> requestsPredicate)
Adds a requests' matcher, which checks if all received stream requests satisfies given
Predicate. |
RequestPatternBuilderStep<ReqT> |
withStatus(Predicate<io.grpc.Status> predicate)
Adds a close
Status matcher, which will check if the close status satisfies given predicate. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithStatusCode, withStatusMessage, withStatusOkwithHeader, withHeader, withHeader, withHeader, withoutHeader, withoutHeaderwithRequestwithFirstRequest, withFirstRequest, withNumberOfRequests, withRequestAtIndex, withRequestAtIndex, withRequests, withRequests, withRequestsContaining, withRequestsContainingpublic RequestPatternBuilderStep<ReqT> withStatus(@Nonnull Predicate<io.grpc.Status> predicate)
StatusMatcherBuilderStepAdds a close Status matcher, which will check if the close status satisfies given predicate.
The status inside the predicate might be null if the request has not finished during the match invocation.
Subsequent status matchers will be added as additional conditions.
withStatus in interface StatusMatcherBuilderStep<RequestPatternBuilderStep<ReqT>>public <T> RequestPatternBuilderImpl<ReqT> withHeader(@Nonnull io.grpc.Metadata.Key<T> headerKey, @Nonnull Predicate<T> predicate)
HeadersMatcherBuilderStepAdds a header matcher for the stub, which will trigger only if the given header
has value satisfying given Predicate.
Subsequent matchers for the same header will replace the old one.
withHeader in interface HeadersMatcherBuilderStep<RequestPatternBuilderStep<ReqT>>public RequestPatternBuilderImpl<ReqT> withRequest(@Nonnull Predicate<ReqT> requestPredicate)
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.
withRequest in interface RequestMatcherBuilderStep<RequestPatternBuilderStep<ReqT>,ReqT>public RequestPatternBuilderStep<ReqT> withRequests(@Nonnull Predicate<List<ReqT>> requestsPredicate)
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.
withRequests in interface StreamRequestMatcherBuilderStep<RequestPatternBuilderStep<ReqT>,ReqT>public void clearRequestsPredicates()
public RequestPattern<ReqT> build()
RequestPatternBuilderStepRequestPattern with given configuration.build in interface RequestPatternBuilderStep<ReqT>Copyright © 2023. All rights reserved.