@Test public void deframedDataAfterCancelShouldBeIgnored() throws Exception { stream().transportState().setId(STREAM_ID); stream().transportState().transportHeadersReceived(grpcResponseHeaders(), false); stream().transportState().transportDataReceived(simpleGrpcFrame(), false); stream().transportState().transportDataReceived(simpleGrpcFrame(), false); stream().request(1); stream().transportState().transportHeadersReceived(grpcResponseTrailers(Status.INTERNAL), true); assertNotNull("message expected", listenerMessageQueue.poll()); assertNull("no additional message expected", listenerMessageQueue.poll()); Metadata trailers = Utils.convertTrailers(grpcResponseTrailers(Status.CANCELLED)); stream().transportState().transportReportStatus(Status.CANCELLED, true, trailers); stream().request(1); assertNull("no additional message expected", listenerMessageQueue.poll()); verify(listener).closed(eq(Status.CANCELLED), same(PROCESSED), eq(trailers)); }
@Override protected TransportState transportState() { return state; }
NettyClientStream extends AbstractClientStream { @Override protected TransportState transportState() { return state; } }
NettyClientStream extends AbstractClientStream { @Override protected TransportState transportState() { return state; } NettyClientStream(
      TransportState state,
      MethodDescriptor<?, ?> method,
      Metadata headers,
      Channel channel,
      AsciiString authority,
      AsciiString scheme,
      AsciiString userAgent,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer,
      CallOptions callOptions); }
NettyClientStream extends AbstractClientStream { @Override protected TransportState transportState() { return state; } NettyClientStream(
      TransportState state,
      MethodDescriptor<?, ?> method,
      Metadata headers,
      Channel channel,
      AsciiString authority,
      AsciiString scheme,
      AsciiString userAgent,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer,
      CallOptions callOptions); @Override void setAuthority(String authority); @Override Attributes getAttributes(); }
NettyClientStream extends AbstractClientStream { @Override protected TransportState transportState() { return state; } NettyClientStream(
      TransportState state,
      MethodDescriptor<?, ?> method,
      Metadata headers,
      Channel channel,
      AsciiString authority,
      AsciiString scheme,
      AsciiString userAgent,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer,
      CallOptions callOptions); @Override void setAuthority(String authority); @Override Attributes getAttributes();  }