@Test public void channelAndInterceptorCalled() { ClientInterceptor interceptor = mock(ClientInterceptor.class, delegatesTo(new NoopInterceptor())); Channel intercepted = ClientInterceptors.intercept(channel, interceptor); CallOptions callOptions = CallOptions.DEFAULT; assertSame(call, intercepted.newCall(method, callOptions)); verify(channel).newCall(same(method), same(callOptions)); verify(interceptor).interceptCall(same(method), same(callOptions), Mockito.<Channel>any()); verifyNoMoreInteractions(channel, interceptor); assertSame(call, intercepted.newCall(method, callOptions)); verify(channel, times(2)).newCall(same(method), same(callOptions)); verify(interceptor, times(2)) .interceptCall(same(method), same(callOptions), Mockito.<Channel>any()); verifyNoMoreInteractions(channel, interceptor); }
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);  }