use of io.grpc.internal.AbstractClientStream2.TransportState in project grpc-java by grpc.
the class AbstractClientStream2Test method inboundHeadersReceived_failsIfStatusReported.
@Test
public void inboundHeadersReceived_failsIfStatusReported() {
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
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.AbstractClientStream2.TransportState in project grpc-java by grpc.
the class AbstractClientStream2Test method inboundDataReceived_failsOnNullFrame.
@Test
public void inboundDataReceived_failsOnNullFrame() {
ClientStreamListener listener = new NoopClientStreamListener();
AbstractClientStream2 stream = new BaseAbstractClientStream(allocator, statsTraceCtx);
stream.start(listener);
TransportState state = stream.transportState();
thrown.expect(NullPointerException.class);
state.inboundDataReceived(null);
}
Aggregations