ServerStreamingCallable { public ServerStream<ResponseT> call(RequestT request) { return call(request, (ApiCallContext) null); } protected  ServerStreamingCallable(); UnaryCallable<RequestT, ResponseT> first(); UnaryCallable<RequestT, List<ResponseT>> all(); ServerStream<ResponseT> call(RequestT request); ServerStream<ResponseT> call(RequestT request, ApiCallContext context); abstract void call(
      RequestT request, ResponseObserver<ResponseT> responseObserver, ApiCallContext context); void call(RequestT request, ResponseObserver<ResponseT> responseObserver); @Deprecated void serverStreamingCall(
      RequestT request,
      final ApiStreamObserver<ResponseT> responseObserver,
      ApiCallContext context); @Deprecated void serverStreamingCall(RequestT request, ApiStreamObserver<ResponseT> responseObserver); @Deprecated Iterator<ResponseT> blockingServerStreamingCall(RequestT request, ApiCallContext context); @Deprecated Iterator<ResponseT> blockingServerStreamingCall(RequestT request); ServerStreamingCallable<RequestT, ResponseT> withDefaultCallContext(
      final ApiCallContext defaultCallContext);  }
@Test public void serverStreaming() { ServerStreamingStashCallable<Integer, Integer> callIntList = new ServerStreamingStashCallable<>(Arrays.asList(0, 1, 2)); ServerStreamingCallable<Integer, Integer> callable = FakeCallableFactory.createServerStreamingCallable( callIntList, StreamingCallSettings.<Integer, Integer>newBuilder().build(), clientContext); AccumulatingStreamObserver responseObserver = new AccumulatingStreamObserver(); callable.call(0, responseObserver); Truth.assertThat(ImmutableList.copyOf(responseObserver.getValues())) .containsExactly(0, 1, 2) .inOrder(); Truth.assertThat(callIntList.getActualRequest()).isEqualTo(0); }
@Test public void blockingServerStreaming() { ServerStreamingStashCallable<Integer, Integer> callIntList = new ServerStreamingStashCallable<>(Arrays.asList(0, 1, 2)); ServerStreamingCallable<Integer, Integer> callable = FakeCallableFactory.createServerStreamingCallable( callIntList, StreamingCallSettings.<Integer, Integer>newBuilder().build(), clientContext); Truth.assertThat(ImmutableList.copyOf(callable.call(0))).containsExactly(0, 1, 2).inOrder(); Truth.assertThat(callIntList.getActualRequest()).isEqualTo(0); }