@Test
public void deliverFailedItemSourceDelegates() {

    // given
    Appender appender = mock(Appender.class);
    when(appender.isStarted()).thenReturn(true);
    Configuration configuration = mock(Configuration.class);
    String testAppenderRef = "testAppenderRef";
    when(configuration.getAppender(testAppenderRef)).thenReturn(appender);
    FailoverPolicy<String> failoverPolicy = spy(createTestFailoverPolicy(testAppenderRef, configuration));
    String failedMessage = UUID.randomUUID().toString();
    ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
    buffer.writeBytes(failedMessage.getBytes());
    FailedItemSource itemSource = new FailedItemSource<>(
            new ByteBufItemSource(buffer, source -> {}),
            new FailedItemInfo(UUID.randomUUID().toString())
    );
    // when
    failoverPolicy.deliver(itemSource);
    // then
    verify(failoverPolicy).deliver(eq(failedMessage));
}