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