@Test public void callNextTwice() { ClientInterceptor interceptor = new ClientInterceptor() { @Override public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall( MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, Channel next) { assertSame(call, next.newCall(method, callOptions)); return next.newCall(method, callOptions); } }; Channel intercepted = ClientInterceptors.intercept(channel, interceptor); assertSame(call, intercepted.newCall(method, CallOptions.DEFAULT)); verify(channel, times(2)).newCall(same(method), same(CallOptions.DEFAULT)); verifyNoMoreInteractions(channel); }
public static Channel intercept(Channel channel, ClientInterceptor... interceptors) { return intercept(channel, Arrays.asList(interceptors)); }
ClientInterceptors { public static Channel intercept(Channel channel, ClientInterceptor... interceptors) { return intercept(channel, Arrays.asList(interceptors)); } }
ClientInterceptors { public static Channel intercept(Channel channel, ClientInterceptor... interceptors) { return intercept(channel, Arrays.asList(interceptors)); } private  ClientInterceptors(); }
ClientInterceptors { public static Channel intercept(Channel channel, ClientInterceptor... interceptors) { return intercept(channel, Arrays.asList(interceptors)); } private  ClientInterceptors(); static Channel interceptForward(Channel channel, ClientInterceptor... interceptors); static Channel interceptForward(Channel channel,
                                         List<? extends ClientInterceptor> interceptors); static Channel intercept(Channel channel, ClientInterceptor... interceptors); static Channel intercept(Channel channel, List<? extends ClientInterceptor> interceptors); }
ClientInterceptors { public static Channel intercept(Channel channel, ClientInterceptor... interceptors) { return intercept(channel, Arrays.asList(interceptors)); } private  ClientInterceptors(); static Channel interceptForward(Channel channel, ClientInterceptor... interceptors); static Channel interceptForward(Channel channel,
                                         List<? extends ClientInterceptor> interceptors); static Channel intercept(Channel channel, ClientInterceptor... interceptors); static Channel intercept(Channel channel, List<? extends ClientInterceptor> interceptors);  }