@Override
    public String convert(final EncryptRuleConfiguration ruleConfig) {
        if (ruleConfig.getTables().isEmpty()) {
            return "";
        }
        StringBuilder result = new StringBuilder(EncryptDistSQLConstants.CREATE_ENCRYPT);
        Iterator<EncryptTableRuleConfiguration> iterator = ruleConfig.getTables().iterator();
        while (iterator.hasNext()) {
            EncryptTableRuleConfiguration tableRuleConfig = iterator.next();
            result.append(String.format(EncryptDistSQLConstants.ENCRYPT, tableRuleConfig.getName(), getEncryptColumns(tableRuleConfig.getColumns(), ruleConfig.getEncryptors())));
            if (iterator.hasNext()) {
                result.append(DistSQLConstants.COMMA).append(System.lineSeparator());
            }
        }
        result.append(DistSQLConstants.SEMI);
        return result.toString();
    }
@Test
    void assertConvertWithEmptyTables() {
        EncryptRuleConfiguration encryptRuleConfig = mock(EncryptRuleConfiguration.class);
        when(encryptRuleConfig.getTables()).thenReturn(Collections.emptyList());
        EncryptRuleConfigurationToDistSQLConverter encryptRuleConfigurationToDistSQLConverter = new EncryptRuleConfigurationToDistSQLConverter();
        assertThat(encryptRuleConfigurationToDistSQLConverter.convert(encryptRuleConfig), is(""));
    }