@Test
public void buildStreamlineEventLogMessage() {

    long timestamp = 1513300663123L;
    String timestampStr = dateFormat.format(timestamp);
    String stormComponentName = "1-Component";
    String streamlineComponent = "Component";
    int taskId = 2;
    Object messageId = "dummy";
    // test root event
    StreamlineEvent event = buildTestEvent();
    List<Object> values = Collections.singletonList(event);
    String expectMessage = String.format("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", timestampStr,
            StreamlineEventLogger.DELIMITER, StreamlineEventLogger.MARKER_FOR_STREAMLINE_EVENT,
            StreamlineEventLogger.DELIMITER, streamlineComponent, StreamlineEventLogger.DELIMITER,
            event.getId(), StreamlineEventLogger.DELIMITER, "[]", StreamlineEventLogger.DELIMITER,
            "[]", StreamlineEventLogger.DELIMITER, ImmutableMap.copyOf(event), StreamlineEventLogger.DELIMITER,
            event.getHeader(), StreamlineEventLogger.DELIMITER, event.getAuxiliaryFieldsAndValues());
    IEventLogger.EventInfo eventInfo = new IEventLogger.EventInfo(timestamp, stormComponentName, taskId,
            messageId, values);
    String actualMessage = sut.buildLogMessage(eventInfo);
    Assert.assertEquals(expectMessage, actualMessage);
    // test event with event correlation information
    EventCorrelationInjector eventCorrelationInjector = new EventCorrelationInjector();
    StreamlineEvent event2 = StreamlineEventImpl.builder().from(event).build();
    StreamlineEvent event3 = StreamlineEventImpl.builder().from(event).build();
    event2 = eventCorrelationInjector.injectCorrelationInformation(event2, Collections.singletonList(event3),
            streamlineComponent);
    event = eventCorrelationInjector.injectCorrelationInformation(event, Collections.singletonList(event2),
            streamlineComponent);
    values = Collections.singletonList(event);
    expectMessage = String.format("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", timestampStr,
            StreamlineEventLogger.DELIMITER, StreamlineEventLogger.MARKER_FOR_STREAMLINE_EVENT,
            StreamlineEventLogger.DELIMITER, streamlineComponent, StreamlineEventLogger.DELIMITER,
            event.getId(), StreamlineEventLogger.DELIMITER, "[" + event3.getId() + "]",
            StreamlineEventLogger.DELIMITER, "[" + event2.getId() + "]",
            StreamlineEventLogger.DELIMITER, ImmutableMap.copyOf(event), StreamlineEventLogger.DELIMITER,
            event.getHeader(), StreamlineEventLogger.DELIMITER, event.getAuxiliaryFieldsAndValues());
    eventInfo = new IEventLogger.EventInfo(timestamp, stormComponentName, taskId, messageId, values);
    actualMessage = sut.buildLogMessage(eventInfo);
    Assert.assertEquals(expectMessage, actualMessage);
}