@Test public void isAuthenticShouldReturnFalseWhenBadUser() throws Exception { when(usersRepository.test(USER, BAD_PASSWORD)).thenReturn(false); assertThat(testee.isAuthentic(BAD_USER, BAD_PASSWORD)).isFalse(); }
@Override public boolean isAuthentic(Username userid, CharSequence passwd) throws MailboxException { try { return repos.test(userid, passwd.toString()); } catch (UsersRepositoryException e) { throw new MailboxException("Unable to access UsersRepository", e); } }
UserRepositoryAuthenticator implements Authenticator { @Override public boolean isAuthentic(Username userid, CharSequence passwd) throws MailboxException { try { return repos.test(userid, passwd.toString()); } catch (UsersRepositoryException e) { throw new MailboxException("Unable to access UsersRepository", e); } } }
UserRepositoryAuthenticator implements Authenticator { @Override public boolean isAuthentic(Username userid, CharSequence passwd) throws MailboxException { try { return repos.test(userid, passwd.toString()); } catch (UsersRepositoryException e) { throw new MailboxException("Unable to access UsersRepository", e); } } @Inject  UserRepositoryAuthenticator(UsersRepository repos); }
UserRepositoryAuthenticator implements Authenticator { @Override public boolean isAuthentic(Username userid, CharSequence passwd) throws MailboxException { try { return repos.test(userid, passwd.toString()); } catch (UsersRepositoryException e) { throw new MailboxException("Unable to access UsersRepository", e); } } @Inject  UserRepositoryAuthenticator(UsersRepository repos); @Override boolean isAuthentic(Username userid, CharSequence passwd); }
UserRepositoryAuthenticator implements Authenticator { @Override public boolean isAuthentic(Username userid, CharSequence passwd) throws MailboxException { try { return repos.test(userid, passwd.toString()); } catch (UsersRepositoryException e) { throw new MailboxException("Unable to access UsersRepository", e); } } @Inject  UserRepositoryAuthenticator(UsersRepository repos); @Override boolean isAuthentic(Username userid, CharSequence passwd);  }