@Test
  public void testQueryMonthWithException() throws Exception {
    long readFailureCountBefore = metrics.readFailureCount.getCount();
    when(mockQueryMonthStatement.executeQuery()).thenThrow(new SQLTransientConnectionException());
    TestUtils.assertException(SQLTransientConnectionException.class,
        () -> aggregatedAccountReportsDao.queryMonthForCluster(clusterName), null);
    assertEquals("Read failure count should be " + (readFailureCountBefore + 1), readFailureCountBefore + 1,
        metrics.readFailureCount.getCount());
  }
Utility to get a {@link DataSource}.
@param mockConnection the connection to use.
@return the {@link DataSource}.
@throws SQLException
ambry-mysql/src/test/java/com/github/ambry/accountstats/AggregatedAccountReportsDaoTest.java