String logFilePattern = "[%d{HH:mm:ss:SSS}][%c{1}][%p]: %m%n";
logFileLoader.load(logFilePath, logFilePattern);
Assert.assertEquals(4, logList.getFilteredLogsNum());
LogEvent logMock = mock(LogEvent.class);
when(logMock.getDate()).thenReturn("13:53:28:632");
when(logMock.getCategoryName()).thenReturn("AbstractBatcher").thenReturn("SQL").thenReturn("AbstractBatcher")
.thenReturn("StringType");
when(logMock.getLevel()).thenReturn("DEBUG");
when(logMock.getMessage())
.thenReturn("about to open PreparedStatement (open PreparedStatements: 0, globally: 0)")
.thenReturn("select\n * \n from\n ( select\n this_.id as y0_ "
+ "\n from\n DET2.company_period this_ \n where\n "
+ "this_.co_id=? \n order by\n this_.period_end desc,\n "
+ "this_.period_length desc ) \n where\n rownum <= ?")
.thenReturn("preparing statement")
.thenReturn("binding '5758' to parameter: 1");
Assert.assertEquals(logMock.getDate(), logList.getFilteredLog(0).getDate());
Assert.assertEquals(logMock.getCategoryName(), logList.getFilteredLog(0).getCategoryName());
Assert.assertEquals(logMock.getLevel(), logList.getFilteredLog(0).getLevel());
Assert.assertEquals(logMock.getMessage(), logList.getFilteredLog(0).getMessage());
Assert.assertEquals(logMock.getDate(), logList.getFilteredLog(1).getDate());
Assert.assertEquals(logMock.getCategoryName(), logList.getFilteredLog(1).getCategoryName());
Assert.assertEquals(logMock.getLevel(), logList.getFilteredLog(1).getLevel());
Assert.assertEquals(logMock.getMessage(), logList.getFilteredLog(1).getMessage());
Assert.assertEquals(logMock.getDate(), logList.getFilteredLog(2).getDate());
Assert.assertEquals(logMock.getCategoryName(), logList.getFilteredLog(2).getCategoryName());
Assert.assertEquals(logMock.getLevel(), logList.getFilteredLog(2).getLevel());
Assert.assertEquals(logMock.getMessage(), logList.getFilteredLog(2).getMessage());
Assert.assertEquals(logMock.getDate(), logList.getFilteredLog(3).getDate());
Assert.assertEquals(logMock.getCategoryName(), logList.getFilteredLog(3).getCategoryName());
Assert.assertEquals(logMock.getLevel(), logList.getFilteredLog(3).getLevel());
Assert.assertEquals(logMock.getMessage(), logList.getFilteredLog(3).getMessage());
}