@Override
    public void refreshTableBackground(Table table, boolean onlyCachedPartitions, ExecutorService executor) {
        DeltaLakeTable deltaLakeTable = (DeltaLakeTable) table;
        cachingMetastore.refreshTableBackground(deltaLakeTable.getDbName(), deltaLakeTable.getTableName());
    }
@Test
    public void testRefreshTableBackground(@Mocked ConnectContext connectContext) throws InterruptedException {
        new Expectations() {
            {
                ConnectContext.get();
                result = connectContext;
                minTimes = 0;

                connectContext.getCommand();
                result = MysqlCommand.COM_QUERY;
                minTimes = 0;
            }
        };

        new MockUp<DeltaUtils>() {
            @mockit.Mock
            public DeltaLakeTable convertDeltaToSRTable(String catalog, String dbName, String tblName, String path,
                                                        Engine deltaEngine, long createTime) {
                return new DeltaLakeTable(1, "delta0", "db1", "table1",
                        Lists.newArrayList(), Lists.newArrayList("ts"), null,
                        "s3://bucket/path/to/table", null, 0);
            }
        };

        DeltaLakeCacheUpdateProcessor deltaLakeCacheUpdateProcessor =
                new DeltaLakeCacheUpdateProcessor(cachingDeltaLakeMetastore);
        Table table = cachingDeltaLakeMetastore.getTable("db1", "table1");

        deltaLakeCacheUpdateProcessor.refreshTableBackground(table, false, executor);
        Assert.assertEquals(1, deltaLakeCacheUpdateProcessor.getCachedTableNames().size());
        Assert.assertTrue(deltaLakeCacheUpdateProcessor.getCachedTableNames().
                contains(DatabaseTableName.of("db1", "table1")));
        Assert.assertTrue(cachingDeltaLakeMetastore.isTablePresent(DatabaseTableName.of("db1", "table1")));

        // sleep 1s, background refresh table will be skipped
        Thread.sleep(1000);
        long oldValue = Config.background_refresh_metadata_time_secs_since_last_access_secs;
        // not refresh table, just skip refresh table
        Config.background_refresh_metadata_time_secs_since_last_access_secs = 0;
        // refresh table again, test skip refresh
        try {
            deltaLakeCacheUpdateProcessor.refreshTableBackground(table, false, executor);
        } finally {
            Config.background_refresh_metadata_time_secs_since_last_access_secs = oldValue;
        }
        Assert.assertFalse(cachingDeltaLakeMetastore.isTablePresent(DatabaseTableName.of("db1", "table1")));
    }