ConsensusReplicationActualTableRuleConfigurationYamlSwapper implements YamlSwapper<YamlConsensusReplicationActualTableRuleConfiguration, ConsensusReplicationActualTableRuleConfiguration> { @Override public YamlConsensusReplicationActualTableRuleConfiguration swapToYamlConfiguration(final ConsensusReplicationActualTableRuleConfiguration data) { YamlConsensusReplicationActualTableRuleConfiguration result = new YamlConsensusReplicationActualTableRuleConfiguration(); result.setPhysicsTable(data.getPhysicsTable()); result.setReplicaGroupId(data.getReplicaGroupId()); result.setReplicaPeers(data.getReplicaPeers()); result.setDataSourceName(data.getDataSourceName()); return result; }  @Override YamlConsensusReplicationActualTableRuleConfiguration swapToYamlConfiguration(final ConsensusReplicationActualTableRuleConfiguration data); @Override ConsensusReplicationActualTableRuleConfiguration swapToObject(final YamlConsensusReplicationActualTableRuleConfiguration yamlConfig);  }
@Test(expected = IllegalArgumentException.class) public void assertSwapToYamlConfigurationWithMinProperties() { swapper.swapToYamlConfiguration(new ConsensusReplicationActualTableRuleConfiguration(null, null, null, null)); }
@Test public void assertSwapToYamlConfigurationWithMaxProperties() { YamlConsensusReplicationActualTableRuleConfiguration yamlConfig = swapper.swapToYamlConfiguration( new ConsensusReplicationActualTableRuleConfiguration(physicsTable, replicaGroupId, replicaPeers, dataSourceName)); assertThat(yamlConfig.getDataSourceName(), is(dataSourceName)); assertThat(yamlConfig.getPhysicsTable(), is(physicsTable)); assertThat(yamlConfig.getReplicaGroupId(), is(replicaGroupId)); assertThat(yamlConfig.getReplicaPeers(), is(replicaPeers)); }