@Test
void shouldDelegateToProtocolPrepareToClose()
{

    EmbeddedChannel channel = newChannelWithProtocolV3();
    EmbeddedChannel anotherChannel = newChannelWithProtocolV3();
    ChannelGroup group = mock( ChannelGroup.class );
    when( group.iterator() ).thenReturn( new Arrays.Iterator<>( new Channel[]{channel, anotherChannel} ) );
    NettyChannelTracker tracker = new NettyChannelTracker( DEV_NULL_METRICS, group, DEV_NULL_LOGGING );
    tracker.prepareToCloseChannels();
    assertThat( channel.outboundMessages().size(), equalTo( 1 ) );
    assertThat( channel.outboundMessages(), hasItem( GoodbyeMessage.GOODBYE ) );
    assertThat( anotherChannel.outboundMessages().size(), equalTo( 1 ) );
    assertThat( anotherChannel.outboundMessages(), hasItem( GoodbyeMessage.GOODBYE ) );
}