use of org.killbill.billing.account.api.MutableAccountData in project killbill by killbill.
the class TestAccountDao method testShouldBeAbleToUpdateSomeFields.
@Test(groups = "slow", description = "Test Account DAO: basic update (2)")
public void testShouldBeAbleToUpdateSomeFields() throws Exception {
final AccountModelDao account = createTestAccount();
accountDao.create(account, internalCallContext);
final MutableAccountData otherAccount = new DefaultAccount(account).toMutableAccountData();
otherAccount.setAddress1(UUID.randomUUID().toString());
otherAccount.setEmail(UUID.randomUUID().toString());
final AccountModelDao newAccount = new AccountModelDao(account.getId(), otherAccount);
accountDao.update(newAccount, internalCallContext);
final AccountModelDao retrievedAccount = accountDao.getById(account.getId(), internalCallContext);
checkAccountsEqual(retrievedAccount, newAccount);
}
use of org.killbill.billing.account.api.MutableAccountData in project killbill by killbill.
the class TestDefaultAccountUserApi method testAccountResetTimeZone.
@Test(groups = "slow", description = "Test failure on resetting timeZone", expectedExceptions = IllegalArgumentException.class)
public void testAccountResetTimeZone() throws Exception {
final Account account = createAccount(new DefaultAccount(createTestAccount()));
// Update the address and leave other fields null
final MutableAccountData mutableAccountData = new DefaultMutableAccountData(account);
mutableAccountData.setTimeZone(null);
DefaultAccount newAccount = new DefaultAccount(account.getId(), mutableAccountData);
accountUserApi.updateAccount(newAccount, callContext);
}
use of org.killbill.billing.account.api.MutableAccountData in project killbill by killbill.
the class TestDefaultAccountUserApi method testAccountResetCurrency.
@Test(groups = "slow", description = "Test failure on resetting currency", expectedExceptions = IllegalArgumentException.class)
public void testAccountResetCurrency() throws Exception {
final Account account = createAccount(new DefaultAccount(createTestAccount()));
// Update the address and leave other fields null
final MutableAccountData mutableAccountData = new DefaultMutableAccountData(account);
mutableAccountData.setCurrency(null);
DefaultAccount newAccount = new DefaultAccount(account.getId(), mutableAccountData);
accountUserApi.updateAccount(newAccount, callContext);
}
use of org.killbill.billing.account.api.MutableAccountData in project killbill by killbill.
the class TestDefaultAccountUserApi method testShouldntBeAbleToUpdateCurrency.
@Test(groups = "slow", expectedExceptions = IllegalArgumentException.class, description = "Test updating Account currency throws an exception")
public void testShouldntBeAbleToUpdateCurrency() throws Exception {
final Account account = createAccount(new DefaultAccount(createTestAccount()));
final MutableAccountData otherAccount = new DefaultAccount(account.getId(), account).toMutableAccountData();
otherAccount.setCurrency(Currency.GBP);
accountUserApi.updateAccount(new DefaultAccount(account.getId(), otherAccount), callContext);
}
use of org.killbill.billing.account.api.MutableAccountData in project killbill by killbill.
the class TestDefaultAccountUserApi method testShouldntBeAbleToUpdateBillCycleDay.
@Test(groups = "slow", expectedExceptions = IllegalArgumentException.class, description = "Test updating Account BCD does throws an exception")
public void testShouldntBeAbleToUpdateBillCycleDay() throws Exception {
final Account account = createAccount(new DefaultAccount(createTestAccount()));
final MutableAccountData otherAccount = new DefaultAccount(account.getId(), account).toMutableAccountData();
otherAccount.setBillCycleDayLocal(account.getBillCycleDayLocal() + 2);
accountUserApi.updateAccount(new DefaultAccount(account.getId(), otherAccount), callContext);
}
Aggregations