@Test
public void appenderDelegatesToItemAppender() {

    // given
    ItemAppender itemAppender = mock(ItemAppender.class);
    ItemAppenderFactory itemAppenderFactory = mockedItemAppenderFactory();
    when(itemAppenderFactory.createInstance(anyBoolean(), any(AbstractLayout.class), any(BatchDelivery.class)))
            .thenReturn(itemAppender);
    ElasticsearchAppender appender = createTestElasticsearchAppender(itemAppenderFactory);
    LogEvent logEvent = mock(LogEvent.class);
    when(logEvent.getTimeMillis()).thenReturn(System.currentTimeMillis());
    // when
    appender.append(logEvent);
    // then
    verify(itemAppender, times(1)).append(anyString(), eq(logEvent));
}