@Test public void testUpdateConfigurationWithPassword() throws IOException { configuration.addConfigurationSource(SimpleSource.forTest(passwordKey, "pwd")); configurationPasswordChecker.assertPasswordCorrect("pwd"); }
public void assertPasswordCorrect(String password) { if (!isPasswordSet()) { throw new IllegalStateException("'" + updateConfigPasswordKey + "' is not set."); } if (!isPasswordCorrect(password)) { throw new IllegalStateException("Wrong password for '" + updateConfigPasswordKey + "'."); } }
ConfigurationPasswordChecker { public void assertPasswordCorrect(String password) { if (!isPasswordSet()) { throw new IllegalStateException("'" + updateConfigPasswordKey + "' is not set."); } if (!isPasswordCorrect(password)) { throw new IllegalStateException("Wrong password for '" + updateConfigPasswordKey + "'."); } } }
ConfigurationPasswordChecker { public void assertPasswordCorrect(String password) { if (!isPasswordSet()) { throw new IllegalStateException("'" + updateConfigPasswordKey + "' is not set."); } if (!isPasswordCorrect(password)) { throw new IllegalStateException("Wrong password for '" + updateConfigPasswordKey + "'."); } } ConfigurationPasswordChecker(ConfigurationRegistry configurationRegistry, String updateConfigPasswordKey); }
ConfigurationPasswordChecker { public void assertPasswordCorrect(String password) { if (!isPasswordSet()) { throw new IllegalStateException("'" + updateConfigPasswordKey + "' is not set."); } if (!isPasswordCorrect(password)) { throw new IllegalStateException("Wrong password for '" + updateConfigPasswordKey + "'."); } } ConfigurationPasswordChecker(ConfigurationRegistry configurationRegistry, String updateConfigPasswordKey); boolean isPasswordCorrect(String password); void assertPasswordCorrect(String password); boolean isPasswordSet(); }
ConfigurationPasswordChecker { public void assertPasswordCorrect(String password) { if (!isPasswordSet()) { throw new IllegalStateException("'" + updateConfigPasswordKey + "' is not set."); } if (!isPasswordCorrect(password)) { throw new IllegalStateException("Wrong password for '" + updateConfigPasswordKey + "'."); } } ConfigurationPasswordChecker(ConfigurationRegistry configurationRegistry, String updateConfigPasswordKey); boolean isPasswordCorrect(String password); void assertPasswordCorrect(String password); boolean isPasswordSet();  }