use of io.grpc.internal.AbstractClientStream.TransportState in project grpc-java by grpc.
the class AbstractClientStreamTest method inboundHeadersReceived_failsIfStatusReported.
@Test
public void inboundHeadersReceived_failsIfStatusReported() {
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx, transportTracer);
stream.start(mockListener);
stream.transportState().transportReportStatus(Status.CANCELLED, false, new Metadata());
TransportState state = stream.transportState();
thrown.expect(IllegalStateException.class);
state.inboundHeadersReceived(new Metadata());
}
use of io.grpc.internal.AbstractClientStream.TransportState in project grpc-java by grpc.
the class AbstractClientStreamTest method inboundDataReceived_failsOnNullFrame.
@Test
public void inboundDataReceived_failsOnNullFrame() {
ClientStreamListener listener = new NoopClientStreamListener();
AbstractClientStream stream = new BaseAbstractClientStream(allocator, statsTraceCtx, transportTracer);
stream.start(listener);
TransportState state = stream.transportState();
thrown.expect(NullPointerException.class);
state.inboundDataReceived(null);
}
Aggregations