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