@Test
void shouldCloseChannelOnFailure() throws Exception
{

    ChannelPromise channelPromise = channel.newPromise();
    InitResponseHandler handler = new InitResponseHandler( channelPromise );
    RuntimeException error = new RuntimeException( "Hi!" );
    handler.onFailure( error );
    ChannelFuture channelCloseFuture = channel.closeFuture();
    channelCloseFuture.await( 5, TimeUnit.SECONDS );
    assertTrue( channelCloseFuture.isSuccess() );
    assertTrue( channelPromise.isDone() );
    assertEquals( error, channelPromise.cause() );
}