use of org.killbill.billing.account.api.DefaultMutableAccountData in project killbill by killbill.
the class TestDefaultAccountUserApi method testAccountChangeExternalKey.
@Test(groups = "slow", description = "Test failure on changing externalKey", expectedExceptions = IllegalArgumentException.class)
public void testAccountChangeExternalKey() throws Exception {
final Account account = createAccount(new DefaultAccount(createTestAccount()));
// Update the address and leave other fields null
final MutableAccountData mutableAccountData = new DefaultMutableAccountData(account);
mutableAccountData.setExternalKey("somethingVeryDifferent");
DefaultAccount newAccount = new DefaultAccount(account.getId(), mutableAccountData);
accountUserApi.updateAccount(newAccount, callContext);
}
use of org.killbill.billing.account.api.DefaultMutableAccountData in project killbill by killbill.
the class TestAccountDao method testMinimalFields.
@Test(groups = "slow", description = "Test Account: verify minimal set of required fields")
public void testMinimalFields() throws Exception {
final String email = UUID.randomUUID().toString();
final String name = UUID.randomUUID().toString();
final AccountData accountData = new DefaultMutableAccountData(null, email, name, 0, null, null, false, 0, null, null, null, null, null, null, null, null, null, null, null, null, false, true);
final AccountModelDao account = new AccountModelDao(UUID.randomUUID(), accountData);
accountDao.create(account, internalCallContext);
final AccountModelDao retrievedAccount = accountDao.getById(account.getId(), internalCallContext);
checkAccountsEqual(retrievedAccount, account);
// Verify a default external key was set
Assert.assertEquals(retrievedAccount.getExternalKey(), retrievedAccount.getId().toString());
// Verify a default time zone was set
Assert.assertEquals(retrievedAccount.getTimeZone(), DateTimeZone.UTC);
}
Aggregations