@Test(expected = PersistenceException.class) @Rollback(true) public void throwsPersistenceExceptionWhenInsertingANewAccountWithDuplicateUsername() { Account existingAccount = createAccountBuilderWithAllFieldsWithoutBannerData().build(); persistence.insertAccount(existingAccount); persistence.flushContext(); persistence.detachEntity(existingAccount); Account accountWithDuplicateUsername = createAccountBuilderWithAllFieldsWithoutBannerData().build(); persistence.insertAccount(accountWithDuplicateUsername); persistence.flushContext(); }
@Override public void insertAccount(@Nonnull final Account account) { create(account); }
AccountBasePersistence extends AbstractBasePersistence<Account, String> implements AccountMapper { @Override public void insertAccount(@Nonnull final Account account) { create(account); } }
AccountBasePersistence extends AbstractBasePersistence<Account, String> implements AccountMapper { @Override public void insertAccount(@Nonnull final Account account) { create(account); }  }
AccountBasePersistence extends AbstractBasePersistence<Account, String> implements AccountMapper { @Override public void insertAccount(@Nonnull final Account account) { create(account); }  Account getAccountByUsername(@Nonnull final String username); Account getAccountByUsernameAndPassword(@Nonnull final String username,
            @Nonnull final String password); Account getAccount(@Nonnull String userId); @Override void insertAccount(@Nonnull final Account account); @Override void updateAccount(@Nonnull final Account account); @Override void insertProfile(@Nonnull final Account account); @Override void insertSignon(@Nonnull final Account account); @Override void updateProfile(@Nonnull final Account account); void updateSignon(@Nonnull final Account account); }
AccountBasePersistence extends AbstractBasePersistence<Account, String> implements AccountMapper { @Override public void insertAccount(@Nonnull final Account account) { create(account); }  Account getAccountByUsername(@Nonnull final String username); Account getAccountByUsernameAndPassword(@Nonnull final String username,
            @Nonnull final String password); Account getAccount(@Nonnull String userId); @Override void insertAccount(@Nonnull final Account account); @Override void updateAccount(@Nonnull final Account account); @Override void insertProfile(@Nonnull final Account account); @Override void insertSignon(@Nonnull final Account account); @Override void updateProfile(@Nonnull final Account account); void updateSignon(@Nonnull final Account account);  }