@Test public void aSuccessfulLoginWillBeAudited() { loginLimitManager.recordSuccessfulAttempt("test-user", "a.b.c.d"); verify(securityAuditManager).logEvent("test-user", "Successful admin console login attempt", "The user logged in successfully to the admin console from address a.b.c.d. "); }
public void recordSuccessfulAttempt(String username, String address) { attemptsPerIP.remove(address); attemptsPerUsername.remove(username); securityAuditManager.logEvent(username, "Successful admin console login attempt", "The user logged in successfully to the admin console from address " + address + ". "); }
LoginLimitManager { public void recordSuccessfulAttempt(String username, String address) { attemptsPerIP.remove(address); attemptsPerUsername.remove(username); securityAuditManager.logEvent(username, "Successful admin console login attempt", "The user logged in successfully to the admin console from address " + address + ". "); } }
LoginLimitManager { public void recordSuccessfulAttempt(String username, String address) { attemptsPerIP.remove(address); attemptsPerUsername.remove(username); securityAuditManager.logEvent(username, "Successful admin console login attempt", "The user logged in successfully to the admin console from address " + address + ". "); } private  LoginLimitManager();   LoginLimitManager(final SecurityAuditManager securityAuditManager, final TaskEngine taskEngine); }
LoginLimitManager { public void recordSuccessfulAttempt(String username, String address) { attemptsPerIP.remove(address); attemptsPerUsername.remove(username); securityAuditManager.logEvent(username, "Successful admin console login attempt", "The user logged in successfully to the admin console from address " + address + ". "); } private  LoginLimitManager();   LoginLimitManager(final SecurityAuditManager securityAuditManager, final TaskEngine taskEngine); static LoginLimitManager getInstance(); boolean hasHitConnectionLimit(String username, String address); void recordFailedAttempt(String username, String address); void recordSuccessfulAttempt(String username, String address); }
LoginLimitManager { public void recordSuccessfulAttempt(String username, String address) { attemptsPerIP.remove(address); attemptsPerUsername.remove(username); securityAuditManager.logEvent(username, "Successful admin console login attempt", "The user logged in successfully to the admin console from address " + address + ". "); } private  LoginLimitManager();   LoginLimitManager(final SecurityAuditManager securityAuditManager, final TaskEngine taskEngine); static LoginLimitManager getInstance(); boolean hasHitConnectionLimit(String username, String address); void recordFailedAttempt(String username, String address); void recordSuccessfulAttempt(String username, String address);  }