@Test
  public void testInsertCopyWithException() throws Exception {
    when(mockInsertCopyStatement.executeUpdate()).thenThrow(new SQLTransientConnectionException());
    TestUtils.assertException(SQLTransientConnectionException.class,
        () -> aggregatedAccountReportsDao.copyAggregatedUsageToMonthlyAggregatedTableForCluster(clusterName), null);
    assertEquals("Copy failure count should be 1", 1, metrics.copyFailureCount.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