use of org.killbill.billing.account.api.DefaultMutableAccountData 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.DefaultMutableAccountData 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.DefaultMutableAccountData in project killbill by killbill.
the class AccountTestUtils method createAccountData.
private static MutableAccountData createAccountData(final int billCycleDayUTC, final int billCycleDayLocal, final String phone) {
final String externalKey = UUID.randomUUID().toString();
final String email = UUID.randomUUID().toString().substring(0, 4) + '@' + UUID.randomUUID().toString().substring(0, 4);
final String name = UUID.randomUUID().toString();
final String locale = Locale.GERMANY.toString();
final DateTimeZone timeZone = DateTimeZone.forID("America/Los_Angeles");
final int firstNameLength = name.length();
final Currency currency = Currency.MXN;
final UUID paymentMethodId = UUID.randomUUID();
final String address1 = UUID.randomUUID().toString();
final String address2 = UUID.randomUUID().toString();
final String companyName = UUID.randomUUID().toString();
final String city = UUID.randomUUID().toString();
final String stateOrProvince = UUID.randomUUID().toString();
final String country = Locale.GERMANY.getCountry();
final String postalCode = UUID.randomUUID().toString().substring(0, 4);
final String notes = UUID.randomUUID().toString();
return new DefaultMutableAccountData(externalKey, email, name, firstNameLength, currency, null, false, billCycleDayLocal, paymentMethodId, timeZone, locale, address1, address2, companyName, city, stateOrProvince, country, postalCode, phone, notes, false, true);
}
use of org.killbill.billing.account.api.DefaultMutableAccountData in project killbill by killbill.
the class TestDefaultAccountUserApi method testAccountChangingTimeZone.
@Test(groups = "slow", description = "Test failure on changing timeZone", expectedExceptions = IllegalArgumentException.class)
public void testAccountChangingTimeZone() 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(DateTimeZone.UTC);
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 TestDefaultAccountUserApi method testAccountResetExternalKey.
@Test(groups = "slow", description = "Test failure on resetting externalKey", expectedExceptions = IllegalArgumentException.class)
public void testAccountResetExternalKey() 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(null);
DefaultAccount newAccount = new DefaultAccount(account.getId(), mutableAccountData);
accountUserApi.updateAccount(newAccount, callContext);
}
Aggregations