@Test public void sufficientFailureIgnored() throws LoginException { whenLoginReturnTrue(requiredDelegate, requisiteDelegate, optionalDelegate); whenLoginThrowInvalidPasswordException(sufficientDelegate); whenCommitReturnTrue(requiredDelegate, requisiteDelegate, optionalDelegate); whenCommitReturnFalse(sufficientDelegate); context.login(); verifyInitialize(requiredDelegate, requisiteDelegate, sufficientDelegate, optionalDelegate); verifyLogin(requiredDelegate, requisiteDelegate, sufficientDelegate, optionalDelegate); verifyCommit(requiredDelegate, requisiteDelegate, sufficientDelegate, optionalDelegate); verifyNoMoreInteractions(requiredDelegate, requisiteDelegate, sufficientDelegate, optionalDelegate); }
public void login() throws LoginException { loginSucceeded = false; if (subject == null) { subject = new Subject(); } try { invoke(LOGIN_METHOD); invoke(COMMIT_METHOD); loginSucceeded = true; } catch (LoginException le) { try { invoke(ABORT_METHOD); } catch (LoginException le2) { throw le; } throw le; } }
LoginContext { public void login() throws LoginException { loginSucceeded = false; if (subject == null) { subject = new Subject(); } try { invoke(LOGIN_METHOD); invoke(COMMIT_METHOD); loginSucceeded = true; } catch (LoginException le) { try { invoke(ABORT_METHOD); } catch (LoginException le2) { throw le; } throw le; } } }
LoginContext { public void login() throws LoginException { loginSucceeded = false; if (subject == null) { subject = new Subject(); } try { invoke(LOGIN_METHOD); invoke(COMMIT_METHOD); loginSucceeded = true; } catch (LoginException le) { try { invoke(ABORT_METHOD); } catch (LoginException le2) { throw le; } throw le; } } LoginContext(AppConfigurationEntry[] entries, 
        CallbackHandler callbackHandler);  LoginContext(AppConfigurationEntry[] entries, Subject subject,
                        CallbackHandler callbackHandler); }
LoginContext { public void login() throws LoginException { loginSucceeded = false; if (subject == null) { subject = new Subject(); } try { invoke(LOGIN_METHOD); invoke(COMMIT_METHOD); loginSucceeded = true; } catch (LoginException le) { try { invoke(ABORT_METHOD); } catch (LoginException le2) { throw le; } throw le; } } LoginContext(AppConfigurationEntry[] entries, 
        CallbackHandler callbackHandler);  LoginContext(AppConfigurationEntry[] entries, Subject subject,
                        CallbackHandler callbackHandler); void login(); void logout(); Subject getSubject(); }
LoginContext { public void login() throws LoginException { loginSucceeded = false; if (subject == null) { subject = new Subject(); } try { invoke(LOGIN_METHOD); invoke(COMMIT_METHOD); loginSucceeded = true; } catch (LoginException le) { try { invoke(ABORT_METHOD); } catch (LoginException le2) { throw le; } throw le; } } LoginContext(AppConfigurationEntry[] entries, 
        CallbackHandler callbackHandler);  LoginContext(AppConfigurationEntry[] entries, Subject subject,
                        CallbackHandler callbackHandler); void login(); void logout(); Subject getSubject();  }