@Test
public void returnsPreviousRolloverTimeIfEventTimeIsBeforeCurrentTime() {

    // given
    LogEvent logEvent = mock(LogEvent.class);
    when(logEvent.getTimeMillis()).thenReturn(DEFAULT_TEST_TIME_IN_MILLIS - TimeUnit.HOURS.toMillis(1));
    IndexNameFormatter formatter = createRollingIndexNameFormatterBuilder().build();
    // when
    String formattedIndexName = formatter.format(logEvent);
    // then
    Assert.assertEquals("testIndexName-2017-12-20-22.54", formattedIndexName);
}