@Test public void transportDataReceived_noHeaderReceived() { BaseTransportState state = new BaseTransportState(transportTracer); state.setListener(mockListener); String testString = "This is a test"; state.transportDataReceived(ReadableBuffers.wrap(testString.getBytes(US_ASCII)), true); verify(mockListener).closed(statusCaptor.capture(), same(PROCESSED), any(Metadata.class)); assertEquals(Code.INTERNAL, statusCaptor.getValue().getCode()); }
protected void transportDataReceived(ReadableBuffer frame, boolean endOfStream) { if (transportError != null) { transportError = transportError.augmentDescription("DATA-----------------------------\n" + ReadableBuffers.readAsString(frame, errorCharset)); frame.close(); if (transportError.getDescription().length() > 1000 || endOfStream) { http2ProcessingFailed(transportError, false, transportErrorMetadata); } } else { if (!headersReceived) { http2ProcessingFailed( Status.INTERNAL.withDescription("headers not received before payload"), false, new Metadata()); return; } inboundDataReceived(frame); if (endOfStream) { transportError = Status.INTERNAL.withDescription("Received unexpected EOS on DATA frame from server."); transportErrorMetadata = new Metadata(); transportReportStatus(transportError, false, transportErrorMetadata); } } }
Http2ClientStreamTransportState extends AbstractClientStream.TransportState { protected void transportDataReceived(ReadableBuffer frame, boolean endOfStream) { if (transportError != null) { transportError = transportError.augmentDescription("DATA-----------------------------\n" + ReadableBuffers.readAsString(frame, errorCharset)); frame.close(); if (transportError.getDescription().length() > 1000 || endOfStream) { http2ProcessingFailed(transportError, false, transportErrorMetadata); } } else { if (!headersReceived) { http2ProcessingFailed( Status.INTERNAL.withDescription("headers not received before payload"), false, new Metadata()); return; } inboundDataReceived(frame); if (endOfStream) { transportError = Status.INTERNAL.withDescription("Received unexpected EOS on DATA frame from server."); transportErrorMetadata = new Metadata(); transportReportStatus(transportError, false, transportErrorMetadata); } } } }
Http2ClientStreamTransportState extends AbstractClientStream.TransportState { protected void transportDataReceived(ReadableBuffer frame, boolean endOfStream) { if (transportError != null) { transportError = transportError.augmentDescription("DATA-----------------------------\n" + ReadableBuffers.readAsString(frame, errorCharset)); frame.close(); if (transportError.getDescription().length() > 1000 || endOfStream) { http2ProcessingFailed(transportError, false, transportErrorMetadata); } } else { if (!headersReceived) { http2ProcessingFailed( Status.INTERNAL.withDescription("headers not received before payload"), false, new Metadata()); return; } inboundDataReceived(frame); if (endOfStream) { transportError = Status.INTERNAL.withDescription("Received unexpected EOS on DATA frame from server."); transportErrorMetadata = new Metadata(); transportReportStatus(transportError, false, transportErrorMetadata); } } } protected  Http2ClientStreamTransportState(
      int maxMessageSize,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer); }
Http2ClientStreamTransportState extends AbstractClientStream.TransportState { protected void transportDataReceived(ReadableBuffer frame, boolean endOfStream) { if (transportError != null) { transportError = transportError.augmentDescription("DATA-----------------------------\n" + ReadableBuffers.readAsString(frame, errorCharset)); frame.close(); if (transportError.getDescription().length() > 1000 || endOfStream) { http2ProcessingFailed(transportError, false, transportErrorMetadata); } } else { if (!headersReceived) { http2ProcessingFailed( Status.INTERNAL.withDescription("headers not received before payload"), false, new Metadata()); return; } inboundDataReceived(frame); if (endOfStream) { transportError = Status.INTERNAL.withDescription("Received unexpected EOS on DATA frame from server."); transportErrorMetadata = new Metadata(); transportReportStatus(transportError, false, transportErrorMetadata); } } } protected  Http2ClientStreamTransportState(
      int maxMessageSize,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer);  }
Http2ClientStreamTransportState extends AbstractClientStream.TransportState { protected void transportDataReceived(ReadableBuffer frame, boolean endOfStream) { if (transportError != null) { transportError = transportError.augmentDescription("DATA-----------------------------\n" + ReadableBuffers.readAsString(frame, errorCharset)); frame.close(); if (transportError.getDescription().length() > 1000 || endOfStream) { http2ProcessingFailed(transportError, false, transportErrorMetadata); } } else { if (!headersReceived) { http2ProcessingFailed( Status.INTERNAL.withDescription("headers not received before payload"), false, new Metadata()); return; } inboundDataReceived(frame); if (endOfStream) { transportError = Status.INTERNAL.withDescription("Received unexpected EOS on DATA frame from server."); transportErrorMetadata = new Metadata(); transportReportStatus(transportError, false, transportErrorMetadata); } } } protected  Http2ClientStreamTransportState(
      int maxMessageSize,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer);   }