EncryptColumnRuleConfigurationYamlSwapper implements YamlSwapper<YamlEncryptColumnRuleConfiguration, EncryptColumnRuleConfiguration> { @Override public YamlEncryptColumnRuleConfiguration swapToYamlConfiguration(final EncryptColumnRuleConfiguration data) { YamlEncryptColumnRuleConfiguration result = new YamlEncryptColumnRuleConfiguration(); result.setPlainColumn(data.getPlainColumn()); result.setCipherColumn(data.getCipherColumn()); result.setAssistedQueryColumn(data.getAssistedQueryColumn()); result.setEncryptorName(data.getEncryptorName()); return result; }  @Override YamlEncryptColumnRuleConfiguration swapToYamlConfiguration(final EncryptColumnRuleConfiguration data); @Override EncryptColumnRuleConfiguration swapToObject(final YamlEncryptColumnRuleConfiguration yamlConfig);  }
@Test public void assertSwapToYamlConfiguration() { EncryptColumnRuleConfigurationYamlSwapper swapper = new EncryptColumnRuleConfigurationYamlSwapper(); EncryptColumnRuleConfiguration encryptColumnRuleConfig = new EncryptColumnRuleConfiguration("logicColumn", "cipherColumn", "assistedQueryColumn", "plainColumn", "encryptorName"); YamlEncryptColumnRuleConfiguration actual = swapper.swapToYamlConfiguration(encryptColumnRuleConfig); assertThat(actual.getCipherColumn(), is("cipherColumn")); assertThat(actual.getAssistedQueryColumn(), is("assistedQueryColumn")); assertThat(actual.getPlainColumn(), is("plainColumn")); assertThat(actual.getEncryptorName(), is("encryptorName")); }