@Override
    public String convert(final ReadwriteSplittingRuleConfiguration ruleConfig) {
        if (ruleConfig.getDataSourceGroups().isEmpty()) {
            return "";
        }
        StringBuilder result = new StringBuilder(ReadwriteSplittingDistSQLConstants.CREATE_READWRITE_SPLITTING_RULE);
        Iterator<ReadwriteSplittingDataSourceGroupRuleConfiguration> iterator = ruleConfig.getDataSourceGroups().iterator();
        while (iterator.hasNext()) {
            appendStaticReadWriteSplittingRule(ruleConfig.getLoadBalancers(), iterator.next(), result);
            if (iterator.hasNext()) {
                result.append(DistSQLConstants.COMMA);
            }
        }
        result.append(DistSQLConstants.SEMI);
        return result.toString();
    }
@Test
    void assertConvertWithEmptyDataSources() {
        ReadwriteSplittingRuleConfiguration readwriteSplittingRuleConfig = mock(ReadwriteSplittingRuleConfiguration.class);
        when(readwriteSplittingRuleConfig.getDataSourceGroups()).thenReturn(Collections.emptyList());
        ReadwriteSplittingRuleConfigurationToDistSQLConverter readwriteSplittingRuleConfigurationToDistSQLConverter = new ReadwriteSplittingRuleConfigurationToDistSQLConverter();
        assertThat(readwriteSplittingRuleConfigurationToDistSQLConverter.convert(readwriteSplittingRuleConfig), is(""));
    }