@Test public void transportTrailersReceived_missingHttpStatus() { BaseTransportState state = new BaseTransportState(transportTracer); state.setListener(mockListener); Metadata trailers = new Metadata(); trailers.put(Metadata.Key.of("content-type", Metadata.ASCII_STRING_MARSHALLER), "application/grpc"); trailers.put(Metadata.Key.of("grpc-status", Metadata.ASCII_STRING_MARSHALLER), "0"); state.transportTrailersReceived(trailers); verify(mockListener, never()).headersRead(any(Metadata.class)); verify(mockListener).closed(statusCaptor.capture(), same(PROCESSED), same(trailers)); assertEquals(Code.INTERNAL, statusCaptor.getValue().getCode()); }
protected void transportTrailersReceived(Metadata trailers) { Preconditions.checkNotNull(trailers, "trailers"); if (transportError == null && !headersReceived) { transportError = validateInitialMetadata(trailers); if (transportError != null) { transportErrorMetadata = trailers; } } if (transportError != null) { transportError = transportError.augmentDescription("trailers: " + trailers); http2ProcessingFailed(transportError, false, transportErrorMetadata); } else { Status status = statusFromTrailers(trailers); stripTransportDetails(trailers); inboundTrailersReceived(trailers, status); } }
Http2ClientStreamTransportState extends AbstractClientStream.TransportState { protected void transportTrailersReceived(Metadata trailers) { Preconditions.checkNotNull(trailers, "trailers"); if (transportError == null && !headersReceived) { transportError = validateInitialMetadata(trailers); if (transportError != null) { transportErrorMetadata = trailers; } } if (transportError != null) { transportError = transportError.augmentDescription("trailers: " + trailers); http2ProcessingFailed(transportError, false, transportErrorMetadata); } else { Status status = statusFromTrailers(trailers); stripTransportDetails(trailers); inboundTrailersReceived(trailers, status); } } }
Http2ClientStreamTransportState extends AbstractClientStream.TransportState { protected void transportTrailersReceived(Metadata trailers) { Preconditions.checkNotNull(trailers, "trailers"); if (transportError == null && !headersReceived) { transportError = validateInitialMetadata(trailers); if (transportError != null) { transportErrorMetadata = trailers; } } if (transportError != null) { transportError = transportError.augmentDescription("trailers: " + trailers); http2ProcessingFailed(transportError, false, transportErrorMetadata); } else { Status status = statusFromTrailers(trailers); stripTransportDetails(trailers); inboundTrailersReceived(trailers, status); } } protected  Http2ClientStreamTransportState(
      int maxMessageSize,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer); }
Http2ClientStreamTransportState extends AbstractClientStream.TransportState { protected void transportTrailersReceived(Metadata trailers) { Preconditions.checkNotNull(trailers, "trailers"); if (transportError == null && !headersReceived) { transportError = validateInitialMetadata(trailers); if (transportError != null) { transportErrorMetadata = trailers; } } if (transportError != null) { transportError = transportError.augmentDescription("trailers: " + trailers); http2ProcessingFailed(transportError, false, transportErrorMetadata); } else { Status status = statusFromTrailers(trailers); stripTransportDetails(trailers); inboundTrailersReceived(trailers, status); } } protected  Http2ClientStreamTransportState(
      int maxMessageSize,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer);  }
Http2ClientStreamTransportState extends AbstractClientStream.TransportState { protected void transportTrailersReceived(Metadata trailers) { Preconditions.checkNotNull(trailers, "trailers"); if (transportError == null && !headersReceived) { transportError = validateInitialMetadata(trailers); if (transportError != null) { transportErrorMetadata = trailers; } } if (transportError != null) { transportError = transportError.augmentDescription("trailers: " + trailers); http2ProcessingFailed(transportError, false, transportErrorMetadata); } else { Status status = statusFromTrailers(trailers); stripTransportDetails(trailers); inboundTrailersReceived(trailers, status); } } protected  Http2ClientStreamTransportState(
      int maxMessageSize,
      StatsTraceContext statsTraceCtx,
      TransportTracer transportTracer);   }