/** * The commons-crypto configuration for the module. */ public Properties cryptoConf() { return CryptoUtils.toCryptoConf("spark.network.crypto.config.", conf.getAll()); }
/** * The commons-crypto configuration for the module. */ public Properties cryptoConf() { return CryptoUtils.toCryptoConf("spark.network.crypto.config.", conf.getAll()); }
/** * The commons-crypto configuration for the module. */ public Properties cryptoConf() { return CryptoUtils.toCryptoConf("spark.network.crypto.config.", conf.getAll()); }
@Test public void testConfConversion() { String prefix = "my.prefix.commons.config."; String confKey1 = prefix + "a.b.c"; String confVal1 = "val1"; String cryptoKey1 = CryptoUtils.COMMONS_CRYPTO_CONFIG_PREFIX + "a.b.c"; String confKey2 = prefix.substring(0, prefix.length() - 1) + "A.b.c"; String confVal2 = "val2"; String cryptoKey2 = CryptoUtils.COMMONS_CRYPTO_CONFIG_PREFIX + "A.b.c"; Map<String, String> conf = ImmutableMap.of( confKey1, confVal1, confKey2, confVal2); Properties cryptoConf = CryptoUtils.toCryptoConf(prefix, conf.entrySet()); assertEquals(confVal1, cryptoConf.getProperty(cryptoKey1)); assertFalse(cryptoConf.containsKey(cryptoKey2)); }
@Test public void testConfConversion() { String prefix = "my.prefix.commons.config."; String confKey1 = prefix + "a.b.c"; String confVal1 = "val1"; String cryptoKey1 = CryptoUtils.COMMONS_CRYPTO_CONFIG_PREFIX + "a.b.c"; String confKey2 = prefix.substring(0, prefix.length() - 1) + "A.b.c"; String confVal2 = "val2"; String cryptoKey2 = CryptoUtils.COMMONS_CRYPTO_CONFIG_PREFIX + "A.b.c"; Map<String, String> conf = ImmutableMap.of( confKey1, confVal1, confKey2, confVal2); Properties cryptoConf = CryptoUtils.toCryptoConf(prefix, conf.entrySet()); assertEquals(confVal1, cryptoConf.getProperty(cryptoKey1)); assertFalse(cryptoConf.containsKey(cryptoKey2)); }