@Test
public void messageOnlyLayout() {

    // given
    ItemAppenderFactory factory = new ItemAppenderFactory();
    String formattedIndexName = UUID.randomUUID().toString();
    BatchDelivery batchDelivery = mock(BatchDelivery.class);
    Layout Layout = mock(Layout.class);
    ItemAppender itemAppender = factory.createInstance(true, Layout, batchDelivery);
    String expectedMessage = UUID.randomUUID().toString();
    LogEvent logEvent = mock(LogEvent.class);
    Message message = mock(Message.class);
    when(message.getFormattedMessage()).thenReturn(expectedMessage);
    when(logEvent.getMessage()).thenReturn(message);
    // when
    itemAppender.append(formattedIndexName, logEvent);
    // then
    assertTrue(itemAppender instanceof StringAppender);
    verify(Layout, never()).toSerializable(any());
    verify(batchDelivery).add(indexNameCaptor.capture(), stringLogCaptor.capture());
    assertEquals(formattedIndexName, indexNameCaptor.getValue());
    assertEquals(expectedMessage, stringLogCaptor.getValue());
}