@Override
    public List<ConfigInfoStateWrapper> findDeletedConfig(final Timestamp startTime, long startId, int pageSize) {
        try {
            HistoryConfigInfoMapper historyConfigInfoMapper = mapperManager.findMapper(
                    dataSourceService.getDataSourceType(), TableConstant.HIS_CONFIG_INFO);
            MapperContext context = new MapperContext();
            context.putWhereParameter(FieldConstant.START_TIME, startTime);
            context.putWhereParameter(FieldConstant.PAGE_SIZE, pageSize);
            context.putWhereParameter(FieldConstant.LAST_MAX_ID, startId);
            
            MapperResult mapperResult = historyConfigInfoMapper.findDeletedConfig(context);
            return jt.query(mapperResult.getSql(), mapperResult.getParamList().toArray(),
                    CONFIG_INFO_STATE_WRAPPER_ROW_MAPPER);
        } catch (DataAccessException e) {
            LogUtil.FATAL_LOG.error("[db-error] " + e, e);
            throw e;
        }
    }
@Test
    void testFindDeletedConfig() {
        
        //mock query list return
        ConfigInfoStateWrapper mockObj1 = new ConfigInfoStateWrapper();
        mockObj1.setDataId("data_id1");
        mockObj1.setGroup("group_id1");
        mockObj1.setTenant("tenant_id1");
        mockObj1.setMd5("md51");
        mockObj1.setLastModified(System.currentTimeMillis());
        
        List<ConfigInfoStateWrapper> list = new ArrayList<>();
        list.add(mockObj1);
        ConfigInfoStateWrapper mockObj2 = new ConfigInfoStateWrapper();
        mockObj2.setDataId("data_id2");
        mockObj2.setGroup("group_id2");
        mockObj2.setTenant("tenant_id2");
        mockObj2.setMd5("md52");
        list.add(mockObj2);
        int pageSize = 1233;
        long startId = 23456;
        Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        Mockito.when(
                        jdbcTemplate.query(anyString(), eq(new Object[] {timestamp, startId, pageSize}), eq(CONFIG_INFO_STATE_WRAPPER_ROW_MAPPER)))
                .thenReturn(list);
        //execute
        List<ConfigInfoStateWrapper> deletedConfig = externalHistoryConfigInfoPersistService.findDeletedConfig(timestamp, startId,
                pageSize);
        //expect verify
        assertEquals("data_id1", deletedConfig.get(0).getDataId());
        assertEquals("group_id1", deletedConfig.get(0).getGroup());
        assertEquals("tenant_id1", deletedConfig.get(0).getTenant());
        assertEquals(mockObj1.getLastModified(), deletedConfig.get(0).getLastModified());
        assertEquals("data_id2", deletedConfig.get(1).getDataId());
        assertEquals("group_id2", deletedConfig.get(1).getGroup());
        assertEquals("tenant_id2", deletedConfig.get(1).getTenant());
        assertEquals(mockObj2.getLastModified(), deletedConfig.get(1).getLastModified());
        
        //mock exception
        Mockito.when(
                        jdbcTemplate.query(anyString(), eq(new Object[] {timestamp, startId, pageSize}), eq(CONFIG_INFO_STATE_WRAPPER_ROW_MAPPER)))
                .thenThrow(new CannotGetJdbcConnectionException("conn error"));
        
        try {
            externalHistoryConfigInfoPersistService.findDeletedConfig(timestamp, startId, pageSize);
            assertTrue(false);
        } catch (Exception e) {
            assertEquals("conn error", e.getMessage());
        }
        
    }