CredentialsConfig extends SimpleComponent<CredentialsConfig> implements PasswordsConfig<CredentialsConfig> { @Override public CredentialsConfig withEncryptedPasswords(final TextEncryptor encryptor) { return toBuilder().password(encryptor.encrypt(password)).build(); }  @Override CredentialsConfig withoutPasswords(); @Override CredentialsConfig withEncryptedPasswords(final TextEncryptor encryptor); @Override CredentialsConfig withDecryptedPasswords(final TextEncryptor encryptor); @Override CredentialsConfig merge(final CredentialsConfig config);  }
@Test public void testWithEncryptedPasswords() { Assert.assertEquals(new CredentialsConfig("user", "encrypted:pass"), decryptedValue.withEncryptedPasswords(encryptor)); }