@Override
    public Optional<ConstraintMetaData> revise(final String tableName, final ConstraintMetaData originalMetaData, final ShardingRule rule) {
        for (DataNode each : shardingTable.getActualDataNodes()) {
            String referencedTableName = originalMetaData.getReferencedTableName();
            Optional<String> logicIndexName = getLogicIndex(originalMetaData.getName(), each.getTableName());
            if (logicIndexName.isPresent()) {
                return Optional.of(new ConstraintMetaData(
                        logicIndexName.get(), rule.getAttributes().getAttribute(DataNodeRuleAttribute.class).findLogicTableByActualTable(referencedTableName).orElse(referencedTableName)));
            }
        }
        return Optional.empty();
    }
@Test
    void assertReviseWhenTableMatches() {
        ConstraintMetaData originalMetaData = new ConstraintMetaData("test_table_name_1", "referenced_table_name");
        Optional<ConstraintMetaData> actual = reviser.revise("table_name_1", originalMetaData, shardingRule);
        assertTrue(actual.isPresent());
        assertThat(actual.get().getName(), is("test"));
        assertThat(actual.get().getReferencedTableName(), is("referenced_table_name"));
    }