@Test
public void shouldLogTimeoutExceptionIfWaitingForConnectionToMainDsTooLong()
        throws SQLException, InterruptedException, UnknownHostException {

    // given:
    Hades<SqlTimeBasedMonitorImpl> hades = new Hades<SqlTimeBasedMonitorImpl>(
            createMockDataSource("mainDs", false, 1100),
            createMockDataSource("failoverDs", false, 0),
            "mainDs",
            "failoverDsName");
    Repo repo = SqlTimeBasedTimerTaskMonitorTest.createSqlTimeRepoMock();
    SqlTimeCalculatorImpl loadCalculator =
            new SqlTimeCalculatorImpl(
                    hades, 1, null, repo, "select", 1, 1);
    SqlTimeBasedTimerTaskMonitor monitor = new SqlTimeBasedTimerTaskMonitor(
            hades, 1, 1, 1, false, false, loadCalculator, 1, 1, 1, repo);
    monitor.init();
    // when:
    monitor.run();
    // then:
    assertEquals(ExceptionEnum.valueForException(new ConnTimeout(new MonitorRunLogPrefix())),
                 monitor.getLastQueryTimeNanos(true));
}