AbstractDataConsistencyChecker implements DataConsistencyChecker { @Override public Map<String, DataConsistencyCheckResult> countCheck() { return shardingScalingJob.getSyncConfigurations() .stream().flatMap(each -> each.getDumperConfiguration().getTableNameMap().values().stream()).collect(Collectors.toSet()) .stream().collect(Collectors.toMap(Function.identity(), this::countCheck)); }  @Override Map<String, DataConsistencyCheckResult> countCheck();  }
@Test public void assertCountCheck() { initTableData(shardingScalingJob.getSyncConfigurations().get(0).getDumperConfiguration().getDataSourceConfiguration()); initTableData(shardingScalingJob.getSyncConfigurations().get(0).getImporterConfiguration().getDataSourceConfiguration()); Map<String, DataConsistencyCheckResult> resultMap = dataConsistencyChecker.countCheck(); assertTrue(resultMap.get("t1").isCountValid()); assertThat(resultMap.get("t1").getSourceCount(), is(resultMap.get("t1").getTargetCount())); }