@Test public void testConverter() { WorkUnitState wuState = new WorkUnitState(); wuState.getJobState().setProp( EncryptionConfigParser.CONVERTER_ENCRYPT_PREFIX + "." + EncryptionConfigParser.ENCRYPTION_ALGORITHM_KEY, "any"); wuState.getJobState().setProp( EncryptionConfigParser.CONVERTER_ENCRYPT_PREFIX + "." + EncryptionConfigParser.ENCRYPTION_KEYSTORE_PATH_KEY, "/tmp/foobar"); wuState.getJobState().setProp( EncryptionConfigParser.CONVERTER_ENCRYPT_PREFIX + "." + EncryptionConfigParser.ENCRYPTION_KEYSTORE_PASSWORD_KEY, "abracadabra"); wuState.getJobState().setProp( EncryptionConfigParser.CONVERTER_ENCRYPT_PREFIX + "." + EncryptionConfigParser.ENCRYPTION_KEY_NAME, "keyname"); wuState.setProp(EncryptionConfigParser.CONVERTER_ENCRYPT_PREFIX + "abc.def", "foobar"); Map<String, Object> parsedProperties = EncryptionConfigParser.getConfigForBranch(EncryptionConfigParser.EntityType.CONVERTER_ENCRYPT, wuState); Assert.assertNotNull(parsedProperties, "Expected parser to only return one record"); Assert.assertEquals(parsedProperties.size(), 4, "Did not expect abc.def to be picked up in config"); Map<String, Object> parsedWriterProperties = EncryptionConfigParser.getConfigForBranch(EncryptionConfigParser.EntityType.WRITER, wuState); Assert.assertNull(parsedWriterProperties, "Did not expect to find writer properties"); }
public static Map<String, Object> getConfigForBranch(EntityType entityType, WorkUnitState workUnitState) { return getConfigForBranch(entityType, null, workUnitState); }
EncryptionConfigParser { public static Map<String, Object> getConfigForBranch(EntityType entityType, WorkUnitState workUnitState) { return getConfigForBranch(entityType, null, workUnitState); } }
EncryptionConfigParser { public static Map<String, Object> getConfigForBranch(EntityType entityType, WorkUnitState workUnitState) { return getConfigForBranch(entityType, null, workUnitState); }  }
EncryptionConfigParser { public static Map<String, Object> getConfigForBranch(EntityType entityType, WorkUnitState workUnitState) { return getConfigForBranch(entityType, null, workUnitState); }  static Map<String, Object> getConfigForBranch(EntityType entityType, WorkUnitState workUnitState); static Map<String, Object> getConfigForBranch(EntityType entityType, String entityName, WorkUnitState workUnitState); static Map<String, Object> getConfigForBranch(EntityType entityType, State taskState, int numBranches, int branch); static String getEncryptionType(Map<String, Object> properties); static String getKeystorePath(Map<String, Object> properties); static String getKeystorePassword(Map<String, Object> properties); static String getKeystoreType(Map<String, Object> parameters); static String getKeyName(Map<String, Object> parameters); static String getKeystoreEncoding(Map<String, Object> parameters); static String getCipher(Map<String, Object> parameters); }
EncryptionConfigParser { public static Map<String, Object> getConfigForBranch(EntityType entityType, WorkUnitState workUnitState) { return getConfigForBranch(entityType, null, workUnitState); }  static Map<String, Object> getConfigForBranch(EntityType entityType, WorkUnitState workUnitState); static Map<String, Object> getConfigForBranch(EntityType entityType, String entityName, WorkUnitState workUnitState); static Map<String, Object> getConfigForBranch(EntityType entityType, State taskState, int numBranches, int branch); static String getEncryptionType(Map<String, Object> properties); static String getKeystorePath(Map<String, Object> properties); static String getKeystorePassword(Map<String, Object> properties); static String getKeystoreType(Map<String, Object> parameters); static String getKeyName(Map<String, Object> parameters); static String getKeystoreEncoding(Map<String, Object> parameters); static String getCipher(Map<String, Object> parameters); static final String ENCRYPTION_ALGORITHM_KEY; static final String ENCRYPTION_KEYSTORE_PATH_KEY; static final String ENCRYPTION_KEYSTORE_PASSWORD_KEY; static final String ENCRYPTION_KEY_NAME; static final String ENCRYPTION_KEYSTORE_TYPE_KEY; static final String ENCRYPTION_KEYSTORE_TYPE_KEY_DEFAULT; static final String ENCRYPTION_KEYSTORE_ENCODING_KEY; static final String ENCRYPTION_KEYSTORE_ENCODING_DEFAULT; static final String ENCRYPTION_TYPE_ANY; static final String ENCRYPTION_CIPHER_KEY; }