@Test
public void builderBuildsLayoutWithProvidedItemSourceFactoryIfConfigured() {

    // given
    JacksonJsonLayout.Builder builder = spy(createDefaultTestBuilder());
    builder.withItemSourceFactory(new LayoutTestItemSourceFactory());
    JacksonJsonLayout layout = builder.build();
    LogEvent logEvent = new Log4jLogEvent();
    // when
    ItemSource itemSource = layout.toSerializable(logEvent);
    // then
    assertEquals(LayoutTestItemSource.class, itemSource.getClass());
}