Search in sources :

Example 16 with MutableAccountData

use of org.killbill.billing.account.api.MutableAccountData 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);
}
Also used : DefaultAccount(org.killbill.billing.account.api.DefaultAccount) AccountTestUtils.createTestAccount(org.killbill.billing.account.AccountTestUtils.createTestAccount) Account(org.killbill.billing.account.api.Account) DefaultAccount(org.killbill.billing.account.api.DefaultAccount) DefaultMutableAccountData(org.killbill.billing.account.api.DefaultMutableAccountData) MutableAccountData(org.killbill.billing.account.api.MutableAccountData) DefaultMutableAccountData(org.killbill.billing.account.api.DefaultMutableAccountData) Test(org.testng.annotations.Test)

Aggregations

MutableAccountData (org.killbill.billing.account.api.MutableAccountData)16 Account (org.killbill.billing.account.api.Account)15 DefaultAccount (org.killbill.billing.account.api.DefaultAccount)15 DefaultMutableAccountData (org.killbill.billing.account.api.DefaultMutableAccountData)15 Test (org.testng.annotations.Test)14 AccountTestUtils.createTestAccount (org.killbill.billing.account.AccountTestUtils.createTestAccount)13 AccountModelDao (org.killbill.billing.account.dao.AccountModelDao)2 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 UUID (java.util.UUID)1 Consumes (javax.ws.rs.Consumes)1 PUT (javax.ws.rs.PUT)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 AccountTestUtils.createAccountData (org.killbill.billing.account.AccountTestUtils.createAccountData)1 AccountApiException (org.killbill.billing.account.api.AccountApiException)1 AccountData (org.killbill.billing.account.api.AccountData)1 CallContext (org.killbill.billing.util.callcontext.CallContext)1 TimedResource (org.killbill.commons.metrics.TimedResource)1