AbstractShardingStrategy implements ShardingStrategy { @Override public void initialize(Map<String, String> settings) { if(settings.containsKey(SHARDED_TABLES)) { setShardedTables(parseNames(settings.get(SHARDED_TABLES))); } if(settings.containsKey(SEPARATOR)) { setSeparator(settings.get(SEPARATOR)); } }  @Override abstract Set<String> locateDbShards(ShardingContext ctx); @Override abstract Set<String> locateTableShards(TableShardingContext ctx); @Override void initialize(Map<String, String> settings); @Override boolean isShardByDb(); @Override boolean isShardByTable(); @Override boolean isShardingEnable(String logicTableName); @Override Set<String> getAllTableShards(); @Override String getTableName(String logicTableName, String shard); static final String SHARDED_TABLES; static final String SEPARATOR; }
@Test public void testInitialize() throws SQLException { try { ShardingStrategy test = new TestShardingStrategy(); Map<String, String> settings = new HashMap<>(); test.initialize(settings); } catch (Exception e) { fail(); } }