ServerCallImpl extends ServerCall<RespT> { @Override public boolean isCancelled() { return cancelled; } ServerCallImpl(ServerStream stream, MethodDescriptor<ReqT, RespT> method,
      Metadata inboundHeaders, Context.CancellableContext context,
      DecompressorRegistry decompressorRegistry, CompressorRegistry compressorRegistry); @Override void request(int numMessages); @Override void sendHeaders(Metadata headers); @Override void sendMessage(RespT message); @Override void setMessageCompression(boolean enable); @Override void setCompression(String compressorName); @Override boolean isReady(); @Override void close(Status status, Metadata trailers); @Override boolean isCancelled(); @Override Attributes attributes();  }
@Test public void streamListener_closedOk() { ServerStreamListenerImpl<Long> streamListener = new ServerCallImpl.ServerStreamListenerImpl<Long>(call, callListener, context); streamListener.closed(Status.OK); verify(callListener).onComplete(); assertTrue(context.isCancelled()); assertNull(context.cancellationCause()); }
@Test public void streamListener_closedCancelled() { ServerStreamListenerImpl<Long> streamListener = new ServerCallImpl.ServerStreamListenerImpl<Long>(call, callListener, context); streamListener.closed(Status.CANCELLED); verify(callListener).onCancel(); assertTrue(context.isCancelled()); assertNull(context.cancellationCause()); }