@Test public void shouldUseSystemPropertiesWrapperForNotifyChanges() { PowerMockito.mockStatic(SystemProperties.class); ExternalTokenConfig config = new ExternalTokenConfig(); config.update(); PowerMockito.verifyStatic(times(7)); SystemProperties.get(anyString()); PowerMockito.verifyStatic(); SystemProperties.getAsBoolean(anyString(), anyBoolean()); }
public void update() { hostname.set(SystemProperties.get(Constants.CTS_STORE_HOSTNAME)); port.set(SystemProperties.get(Constants.CTS_STORE_PORT)); username.set(SystemProperties.get(Constants.CTS_STORE_USERNAME)); password.set(AMPasswordUtil.decrypt(SystemProperties.get(Constants.CTS_STORE_PASSWORD))); maxConnections.set(SystemProperties.get(Constants.CTS_MAX_CONNECTIONS)); sslMode.set(SystemProperties.getAsBoolean(Constants.CTS_SSL_ENABLED, false)); String heartbeatStr = SystemProperties.get(Constants.LDAP_HEARTBEAT); if (StringUtils.isNotEmpty(heartbeatStr)) { try { heartbeat.set(Integer.parseInt(heartbeatStr)); } catch (NumberFormatException e) { heartbeat.set(new Integer(-1)); } } else { heartbeat.set(new Integer(-1)); } String mode = SystemProperties.get(Constants.CTS_STORE_LOCATION); if (StringUtils.isNotEmpty(mode)) { storeMode.set(StoreMode.valueOf(mode.toUpperCase())); } else { storeMode.set(StoreMode.DEFAULT); } }
ExternalTokenConfig { public void update() { hostname.set(SystemProperties.get(Constants.CTS_STORE_HOSTNAME)); port.set(SystemProperties.get(Constants.CTS_STORE_PORT)); username.set(SystemProperties.get(Constants.CTS_STORE_USERNAME)); password.set(AMPasswordUtil.decrypt(SystemProperties.get(Constants.CTS_STORE_PASSWORD))); maxConnections.set(SystemProperties.get(Constants.CTS_MAX_CONNECTIONS)); sslMode.set(SystemProperties.getAsBoolean(Constants.CTS_SSL_ENABLED, false)); String heartbeatStr = SystemProperties.get(Constants.LDAP_HEARTBEAT); if (StringUtils.isNotEmpty(heartbeatStr)) { try { heartbeat.set(Integer.parseInt(heartbeatStr)); } catch (NumberFormatException e) { heartbeat.set(new Integer(-1)); } } else { heartbeat.set(new Integer(-1)); } String mode = SystemProperties.get(Constants.CTS_STORE_LOCATION); if (StringUtils.isNotEmpty(mode)) { storeMode.set(StoreMode.valueOf(mode.toUpperCase())); } else { storeMode.set(StoreMode.DEFAULT); } } }
ExternalTokenConfig { public void update() { hostname.set(SystemProperties.get(Constants.CTS_STORE_HOSTNAME)); port.set(SystemProperties.get(Constants.CTS_STORE_PORT)); username.set(SystemProperties.get(Constants.CTS_STORE_USERNAME)); password.set(AMPasswordUtil.decrypt(SystemProperties.get(Constants.CTS_STORE_PASSWORD))); maxConnections.set(SystemProperties.get(Constants.CTS_MAX_CONNECTIONS)); sslMode.set(SystemProperties.getAsBoolean(Constants.CTS_SSL_ENABLED, false)); String heartbeatStr = SystemProperties.get(Constants.LDAP_HEARTBEAT); if (StringUtils.isNotEmpty(heartbeatStr)) { try { heartbeat.set(Integer.parseInt(heartbeatStr)); } catch (NumberFormatException e) { heartbeat.set(new Integer(-1)); } } else { heartbeat.set(new Integer(-1)); } String mode = SystemProperties.get(Constants.CTS_STORE_LOCATION); if (StringUtils.isNotEmpty(mode)) { storeMode.set(StoreMode.valueOf(mode.toUpperCase())); } else { storeMode.set(StoreMode.DEFAULT); } } @Inject  ExternalTokenConfig(); }
ExternalTokenConfig { public void update() { hostname.set(SystemProperties.get(Constants.CTS_STORE_HOSTNAME)); port.set(SystemProperties.get(Constants.CTS_STORE_PORT)); username.set(SystemProperties.get(Constants.CTS_STORE_USERNAME)); password.set(AMPasswordUtil.decrypt(SystemProperties.get(Constants.CTS_STORE_PASSWORD))); maxConnections.set(SystemProperties.get(Constants.CTS_MAX_CONNECTIONS)); sslMode.set(SystemProperties.getAsBoolean(Constants.CTS_SSL_ENABLED, false)); String heartbeatStr = SystemProperties.get(Constants.LDAP_HEARTBEAT); if (StringUtils.isNotEmpty(heartbeatStr)) { try { heartbeat.set(Integer.parseInt(heartbeatStr)); } catch (NumberFormatException e) { heartbeat.set(new Integer(-1)); } } else { heartbeat.set(new Integer(-1)); } String mode = SystemProperties.get(Constants.CTS_STORE_LOCATION); if (StringUtils.isNotEmpty(mode)) { storeMode.set(StoreMode.valueOf(mode.toUpperCase())); } else { storeMode.set(StoreMode.DEFAULT); } } @Inject  ExternalTokenConfig(); StoreMode getStoreMode(); String getHostname(); String getPort(); String getUsername(); String getPassword(); String getMaxConnections(); int getHeartbeat(); boolean isSslMode(); boolean hasChanged(); void update(); }
ExternalTokenConfig { public void update() { hostname.set(SystemProperties.get(Constants.CTS_STORE_HOSTNAME)); port.set(SystemProperties.get(Constants.CTS_STORE_PORT)); username.set(SystemProperties.get(Constants.CTS_STORE_USERNAME)); password.set(AMPasswordUtil.decrypt(SystemProperties.get(Constants.CTS_STORE_PASSWORD))); maxConnections.set(SystemProperties.get(Constants.CTS_MAX_CONNECTIONS)); sslMode.set(SystemProperties.getAsBoolean(Constants.CTS_SSL_ENABLED, false)); String heartbeatStr = SystemProperties.get(Constants.LDAP_HEARTBEAT); if (StringUtils.isNotEmpty(heartbeatStr)) { try { heartbeat.set(Integer.parseInt(heartbeatStr)); } catch (NumberFormatException e) { heartbeat.set(new Integer(-1)); } } else { heartbeat.set(new Integer(-1)); } String mode = SystemProperties.get(Constants.CTS_STORE_LOCATION); if (StringUtils.isNotEmpty(mode)) { storeMode.set(StoreMode.valueOf(mode.toUpperCase())); } else { storeMode.set(StoreMode.DEFAULT); } } @Inject  ExternalTokenConfig(); StoreMode getStoreMode(); String getHostname(); String getPort(); String getUsername(); String getPassword(); String getMaxConnections(); int getHeartbeat(); boolean isSslMode(); boolean hasChanged(); void update();  }