@Test(expected = NullPointerException.class) public void getAccountByUsernameAndPassword_shouldThrowNPEForNullPasswordArgument() { accountDao.getAccountByUsernameAndPassword("username", null); }
public Account getAccountByUsernameAndPassword(final String username, final String password) { checkNotNull(emptyToNull(username), "Argument[username] must not be empty or null"); checkNotNull(emptyToNull(password), "Argument[password] must not be empty or null"); Account account = getAccountByUsername(username); return password.equals(account.getPassword()) ? account : null; }
AccountDao extends AbstractBaseDao<Account, String> implements AccountMapper { public Account getAccountByUsernameAndPassword(final String username, final String password) { checkNotNull(emptyToNull(username), "Argument[username] must not be empty or null"); checkNotNull(emptyToNull(password), "Argument[password] must not be empty or null"); Account account = getAccountByUsername(username); return password.equals(account.getPassword()) ? account : null; } }
AccountDao extends AbstractBaseDao<Account, String> implements AccountMapper { public Account getAccountByUsernameAndPassword(final String username, final String password) { checkNotNull(emptyToNull(username), "Argument[username] must not be empty or null"); checkNotNull(emptyToNull(password), "Argument[password] must not be empty or null"); Account account = getAccountByUsername(username); return password.equals(account.getPassword()) ? account : null; } AccountDao(String collectionName); }
AccountDao extends AbstractBaseDao<Account, String> implements AccountMapper { public Account getAccountByUsernameAndPassword(final String username, final String password) { checkNotNull(emptyToNull(username), "Argument[username] must not be empty or null"); checkNotNull(emptyToNull(password), "Argument[password] must not be empty or null"); Account account = getAccountByUsername(username); return password.equals(account.getPassword()) ? account : null; } AccountDao(String collectionName); Account getAccountByUsername(final String username); Account getAccountByUsernameAndPassword(final String username, final String password); void insertAccount(@Nonnull final Account account); void updateAccount(@Nonnull final Account account); void deleteAccount(@Nonnull final String username); void insertProfile(final Account account); void insertSignon(final Account account); void updateProfile(final Account account); void updateSignon(final Account account); }
AccountDao extends AbstractBaseDao<Account, String> implements AccountMapper { public Account getAccountByUsernameAndPassword(final String username, final String password) { checkNotNull(emptyToNull(username), "Argument[username] must not be empty or null"); checkNotNull(emptyToNull(password), "Argument[password] must not be empty or null"); Account account = getAccountByUsername(username); return password.equals(account.getPassword()) ? account : null; } AccountDao(String collectionName); Account getAccountByUsername(final String username); Account getAccountByUsernameAndPassword(final String username, final String password); void insertAccount(@Nonnull final Account account); void updateAccount(@Nonnull final Account account); void deleteAccount(@Nonnull final String username); void insertProfile(final Account account); void insertSignon(final Account account); void updateProfile(final Account account); void updateSignon(final Account account);  }