use of io.libp2p.core.ConnectionClosedException in project teku by ConsenSys.
the class RpcHandlerTest method sendRequest_streamClosedRightBeforeCreateStreamShouldThrowPeerDisconnectedException.
@Test
void sendRequest_streamClosedRightBeforeCreateStreamShouldThrowPeerDisconnectedException() {
when(session.createStream((ProtocolBinding<Controller<RpcRequestHandler>>) any())).thenThrow(new ConnectionClosedException());
SafeFuture<RpcStreamController<RpcRequestHandler>> future = rpcHandler.sendRequest(connection, request, responseHandler);
assertThatSafeFuture(future).isCompletedExceptionallyWith(PeerDisconnectedException.class);
}
Aggregations