ShardingSphereAlgorithmConfigurationYamlSwapper implements YamlSwapper<YamlShardingSphereAlgorithmConfiguration, ShardingSphereAlgorithmConfiguration> { @Override public YamlShardingSphereAlgorithmConfiguration swapToYamlConfiguration(final ShardingSphereAlgorithmConfiguration data) { YamlShardingSphereAlgorithmConfiguration result = new YamlShardingSphereAlgorithmConfiguration(); result.setType(data.getType()); result.setProps(data.getProps()); return result; }  @Override YamlShardingSphereAlgorithmConfiguration swapToYamlConfiguration(final ShardingSphereAlgorithmConfiguration data); @Override ShardingSphereAlgorithmConfiguration swapToObject(final YamlShardingSphereAlgorithmConfiguration yamlConfig);  }
@Test public void assertSwapToYaml() { YamlShardingSphereAlgorithmConfiguration actual = new ShardingSphereAlgorithmConfigurationYamlSwapper().swapToYamlConfiguration( new ShardingSphereAlgorithmConfiguration("TEST", createProps())); assertThat(actual.getType(), is("TEST")); assertThat(actual.getProps().getProperty("key"), is("value")); }