GovernanceCenterConfigurationYamlSwapper implements YamlSwapper<YamlGovernanceCenterConfiguration, GovernanceCenterConfiguration> { @Override public YamlGovernanceCenterConfiguration swapToYamlConfiguration(final GovernanceCenterConfiguration config) { YamlGovernanceCenterConfiguration result = new YamlGovernanceCenterConfiguration(); result.setType(config.getType()); result.setServerLists(config.getServerLists()); result.setProps(config.getProps()); return result; }  @Override YamlGovernanceCenterConfiguration swapToYamlConfiguration(final GovernanceCenterConfiguration config); @Override GovernanceCenterConfiguration swapToObject(final YamlGovernanceCenterConfiguration yamlConfig);  }
@Test public void assertToYamlConfiguration() { GovernanceCenterConfiguration expected = new GovernanceCenterConfiguration("TEST", "127.0.0.1:2181", new Properties()); YamlGovernanceCenterConfiguration actual = new GovernanceCenterConfigurationYamlSwapper().swapToYamlConfiguration(expected); assertThat(actual.getType(), is(expected.getType())); assertThat(actual.getServerLists(), is(expected.getServerLists())); assertThat(actual.getProps(), is(expected.getProps())); }