@Test public void serverSendsOne_canErrorWithoutResponse() { final String description = "test description"; final Status status = Status.RESOURCE_EXHAUSTED.withDescription(description); final Metadata metadata = new Metadata(); call.close(status, metadata); verify(stream, times(1)).close(same(status), same(metadata)); }
@Override public void close(Status status, Metadata trailers) { checkState(!closeCalled, "call already closed"); try { closeCalled = true; if (status.isOk() && method.getType().serverSendsOneMessage() && !messageSent) { internalClose(Status.INTERNAL.withDescription(MISSING_RESPONSE)); return; } stream.close(status, trailers); } finally { serverCallTracer.reportCallEnded(status.isOk()); } }
ServerCallImpl extends ServerCall<ReqT, RespT> { @Override public void close(Status status, Metadata trailers) { checkState(!closeCalled, "call already closed"); try { closeCalled = true; if (status.isOk() && method.getType().serverSendsOneMessage() && !messageSent) { internalClose(Status.INTERNAL.withDescription(MISSING_RESPONSE)); return; } stream.close(status, trailers); } finally { serverCallTracer.reportCallEnded(status.isOk()); } } }
ServerCallImpl extends ServerCall<ReqT, RespT> { @Override public void close(Status status, Metadata trailers) { checkState(!closeCalled, "call already closed"); try { closeCalled = true; if (status.isOk() && method.getType().serverSendsOneMessage() && !messageSent) { internalClose(Status.INTERNAL.withDescription(MISSING_RESPONSE)); return; } stream.close(status, trailers); } finally { serverCallTracer.reportCallEnded(status.isOk()); } } ServerCallImpl(ServerStream stream, MethodDescriptor<ReqT, RespT> method,
      Metadata inboundHeaders, Context.CancellableContext context,
      DecompressorRegistry decompressorRegistry, CompressorRegistry compressorRegistry,
      CallTracer serverCallTracer); }
ServerCallImpl extends ServerCall<ReqT, RespT> { @Override public void close(Status status, Metadata trailers) { checkState(!closeCalled, "call already closed"); try { closeCalled = true; if (status.isOk() && method.getType().serverSendsOneMessage() && !messageSent) { internalClose(Status.INTERNAL.withDescription(MISSING_RESPONSE)); return; } stream.close(status, trailers); } finally { serverCallTracer.reportCallEnded(status.isOk()); } } ServerCallImpl(ServerStream stream, MethodDescriptor<ReqT, RespT> method,
      Metadata inboundHeaders, Context.CancellableContext context,
      DecompressorRegistry decompressorRegistry, CompressorRegistry compressorRegistry,
      CallTracer serverCallTracer); @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 getAttributes(); @Override String getAuthority(); @Override MethodDescriptor<ReqT, RespT> getMethodDescriptor(); }
ServerCallImpl extends ServerCall<ReqT, RespT> { @Override public void close(Status status, Metadata trailers) { checkState(!closeCalled, "call already closed"); try { closeCalled = true; if (status.isOk() && method.getType().serverSendsOneMessage() && !messageSent) { internalClose(Status.INTERNAL.withDescription(MISSING_RESPONSE)); return; } stream.close(status, trailers); } finally { serverCallTracer.reportCallEnded(status.isOk()); } } ServerCallImpl(ServerStream stream, MethodDescriptor<ReqT, RespT> method,
      Metadata inboundHeaders, Context.CancellableContext context,
      DecompressorRegistry decompressorRegistry, CompressorRegistry compressorRegistry,
      CallTracer serverCallTracer); @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 getAttributes(); @Override String getAuthority(); @Override MethodDescriptor<ReqT, RespT> getMethodDescriptor();  }