@Test void linkNotPasswordVariable() { final JdbcConnection jdbcConnection = createJdbcConnection("${" + GATEWAY + "}"); linker.link(jdbcConnection, new Bundle(), new Bundle()); assertNull(jdbcConnection.getPasswordRef()); assertEquals("${" + GATEWAY + "}", jdbcConnection.getPassword()); assertNotNull(jdbcConnection.getPassword()); }
@Override public void link(JdbcConnection entity, Bundle bundle, Bundle targetBundle) { if (entity.getPassword() != null) { if (entity.getPassword().startsWith(ENCRYPTED_PASSWORD_PREFIX)) { entity.setPassword(null); } else { String storedPasswordReference = extractVariableName(entity.getPassword()); if (!isEmpty(storedPasswordReference)) { Matcher matcher = STORED_PASSWORD_PATTERN.matcher(storedPasswordReference); if (matcher.matches()) { String storedPasswordName = matcher.group(1); setPasswordRef(entity, bundle, storedPasswordName); } } } } }
JdbcConnectionLinker implements EntityLinker<JdbcConnection> { @Override public void link(JdbcConnection entity, Bundle bundle, Bundle targetBundle) { if (entity.getPassword() != null) { if (entity.getPassword().startsWith(ENCRYPTED_PASSWORD_PREFIX)) { entity.setPassword(null); } else { String storedPasswordReference = extractVariableName(entity.getPassword()); if (!isEmpty(storedPasswordReference)) { Matcher matcher = STORED_PASSWORD_PATTERN.matcher(storedPasswordReference); if (matcher.matches()) { String storedPasswordName = matcher.group(1); setPasswordRef(entity, bundle, storedPasswordName); } } } } } }
JdbcConnectionLinker implements EntityLinker<JdbcConnection> { @Override public void link(JdbcConnection entity, Bundle bundle, Bundle targetBundle) { if (entity.getPassword() != null) { if (entity.getPassword().startsWith(ENCRYPTED_PASSWORD_PREFIX)) { entity.setPassword(null); } else { String storedPasswordReference = extractVariableName(entity.getPassword()); if (!isEmpty(storedPasswordReference)) { Matcher matcher = STORED_PASSWORD_PATTERN.matcher(storedPasswordReference); if (matcher.matches()) { String storedPasswordName = matcher.group(1); setPasswordRef(entity, bundle, storedPasswordName); } } } } }  }
JdbcConnectionLinker implements EntityLinker<JdbcConnection> { @Override public void link(JdbcConnection entity, Bundle bundle, Bundle targetBundle) { if (entity.getPassword() != null) { if (entity.getPassword().startsWith(ENCRYPTED_PASSWORD_PREFIX)) { entity.setPassword(null); } else { String storedPasswordReference = extractVariableName(entity.getPassword()); if (!isEmpty(storedPasswordReference)) { Matcher matcher = STORED_PASSWORD_PATTERN.matcher(storedPasswordReference); if (matcher.matches()) { String storedPasswordName = matcher.group(1); setPasswordRef(entity, bundle, storedPasswordName); } } } } }  @Override void link(JdbcConnection entity, Bundle bundle, Bundle targetBundle); @Override Class<JdbcConnection> getEntityClass(); }
JdbcConnectionLinker implements EntityLinker<JdbcConnection> { @Override public void link(JdbcConnection entity, Bundle bundle, Bundle targetBundle) { if (entity.getPassword() != null) { if (entity.getPassword().startsWith(ENCRYPTED_PASSWORD_PREFIX)) { entity.setPassword(null); } else { String storedPasswordReference = extractVariableName(entity.getPassword()); if (!isEmpty(storedPasswordReference)) { Matcher matcher = STORED_PASSWORD_PATTERN.matcher(storedPasswordReference); if (matcher.matches()) { String storedPasswordName = matcher.group(1); setPasswordRef(entity, bundle, storedPasswordName); } } } } }  @Override void link(JdbcConnection entity, Bundle bundle, Bundle targetBundle); @Override Class<JdbcConnection> getEntityClass();  }