@Test
void shouldWriteHandshakeWhenChannelConnected()
{

    ChannelPromise handshakeCompletedPromise = channel.newPromise();
    ChannelConnectedListener listener = newListener( handshakeCompletedPromise );
    ChannelPromise channelConnectedPromise = channel.newPromise();
    channelConnectedPromise.setSuccess();
    listener.operationComplete( channelConnectedPromise );
    assertNotNull( channel.pipeline().get( HandshakeHandler.class ) );
    assertTrue( channel.finish() );
    assertEquals( handshakeBuf(), channel.readOutbound() );
}