### Question:
DefaultKillbillConfigSource implements KillbillConfigSource, OSGIConfigProperties { @Override public String getString(final String propertyName) { return properties.getProperty(propertyName); } DefaultKillbillConfigSource();  DefaultKillbillConfigSource(final Map<String, String> extraDefaultProperties);  DefaultKillbillConfigSource(@Nullable final String file);  DefaultKillbillConfigSource(@Nullable final String file, final Map<String, String> extraDefaultProperties); @Override String getString(final String propertyName); @Override Properties getProperties(); @VisibleForTesting void setProperty(final String propertyName, final Object propertyValue);  }### Answer:
@Test(groups = "fast") public void testJasyptDisabledByDefault() throws IOException, URISyntaxException { DefaultKillbillConfigSource configSource = new DefaultKillbillConfigSource(); String enableJasyptString = configSource.getString(ENABLE_JASYPT_PROPERTY); Assert.assertFalse(Boolean.parseBoolean(enableJasyptString)); }
@Test(groups = "fast") public void testDecyptionExplicitlyDisabled() throws IOException, URISyntaxException { String unencryptedValue = "myPropertyValue"; String encryptedValue = encString(unencryptedValue); Map<String, String> properties = ImmutableMap.of(ENABLE_JASYPT_PROPERTY, "false", ENCRYPTED_PROPERTY_1, encryptedValue, JASYPT_ENCRYPTOR_PASSWORD_PROPERTY, JASYPT_PASSWORD, JASYPT_ENCRYPTOR_ALGORITHM_PROPERTY, JASYPT_ALGORITHM); DefaultKillbillConfigSource configSource = new DefaultKillbillConfigSource(properties); String actualValue = configSource.getString(ENCRYPTED_PROPERTY_1); Assert.assertEquals(encryptedValue, actualValue); }
@Test(groups = "fast") public void testDecryptJasyptPropertySuccessfully() throws IOException, URISyntaxException { String unencryptedValue1 = "myPropertyValue"; String encryptedValue1 = encString(unencryptedValue1); String unencryptedValue2 = "myOtherPropertyValue"; String encryptedValue2 = encString(unencryptedValue2); Map<String, String> properties = ImmutableMap.of(ENABLE_JASYPT_PROPERTY, "true", ENCRYPTED_PROPERTY_1, encryptedValue1, ENCRYPTED_PROPERTY_2, encryptedValue2, JASYPT_ENCRYPTOR_PASSWORD_PROPERTY, JASYPT_PASSWORD, JASYPT_ENCRYPTOR_ALGORITHM_PROPERTY, JASYPT_ALGORITHM); DefaultKillbillConfigSource configSource = new DefaultKillbillConfigSource(properties); String actualValue1 = configSource.getString(ENCRYPTED_PROPERTY_1); String actualValue2 = configSource.getString(ENCRYPTED_PROPERTY_2); Assert.assertEquals(unencryptedValue1, actualValue1); Assert.assertEquals(unencryptedValue2, actualValue2); }