@Test public void insertAccount_shouldInsertNewAccountIntoCollection() { Account newAccount = createAccountBuilderWithAllFields().build(); accountDao.insertAccount(newAccount); DBObject accountObj = collection.findOne(new BasicDBObject("_id", newAccount.getUsername())); assertThat("Cannot find account with username [" + newAccount.getUsername() + "]", accountObj, notNullValue()); Account persistedAccount = Account.fromDBObject(accountObj); assertReflectionEquals(newAccount, persistedAccount); }
public void insertAccount(@Nonnull final Account account) { checkNotNull(account, "Argument[account] must not be null"); super.create(account); logger.info("Inserted new account[{}]", account); }
AccountDao extends AbstractBaseDao<Account, String> implements AccountMapper { public void insertAccount(@Nonnull final Account account) { checkNotNull(account, "Argument[account] must not be null"); super.create(account); logger.info("Inserted new account[{}]", account); } }
AccountDao extends AbstractBaseDao<Account, String> implements AccountMapper { public void insertAccount(@Nonnull final Account account) { checkNotNull(account, "Argument[account] must not be null"); super.create(account); logger.info("Inserted new account[{}]", account); } AccountDao(String collectionName); }
AccountDao extends AbstractBaseDao<Account, String> implements AccountMapper { public void insertAccount(@Nonnull final Account account) { checkNotNull(account, "Argument[account] must not be null"); super.create(account); logger.info("Inserted new account[{}]", account); } 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 void insertAccount(@Nonnull final Account account) { checkNotNull(account, "Argument[account] must not be null"); super.create(account); logger.info("Inserted new account[{}]", account); } 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);  }