本文整理了Java中org.killbill.billing.account.api.Account.getId()
方法的一些代码示例,展示了Account.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Account.getId()
方法的具体详情如下:
包路径:org.killbill.billing.account.api.Account
类名称:Account
方法名:getId
暂无
代码示例来源:origin: killbill/killbill
@Override
public Account getAccountById(final UUID uid, final TenantContext context) {
for (final Account account : accounts) {
if (uid.equals(account.getId())) {
return account;
}
}
return null;
}
代码示例来源:origin: killbill/killbill
@Override
public void updateAccount(final String externalKey, final AccountData accountData, final CallContext context) throws AccountApiException {
final Account currentAccount = getAccountByKey(externalKey, context);
if (currentAccount == null) {
throw new AccountApiException(ErrorCode.ACCOUNT_DOES_NOT_EXIST_FOR_KEY, externalKey);
}
updateAccount(currentAccount.getId(), accountData, false, context);
}
代码示例来源:origin: killbill/killbill
@Override
public UUID getIdFromKey(final String externalKey, final TenantContext context) {
for (final Account account : accounts) {
if (externalKey.equals(account.getExternalKey())) {
return account.getId();
}
}
return null;
}
代码示例来源:origin: killbill/killbill
private void insertOverdueCheckAndVerifyQueueContent(final Account account, final int nbDaysInFuture, final int expectedNbDaysInFuture) throws IOException {
final DateTime futureNotificationTime = testReferenceTime.plusDays(nbDaysInFuture);
final OverdueCheckNotificationKey notificationKey = new OverdueCheckNotificationKey(account.getId());
checkPoster.insertOverdueNotification(account.getId(), futureNotificationTime, OverdueCheckNotifier.OVERDUE_CHECK_NOTIFIER_QUEUE, notificationKey, internalCallContext);
final List<NotificationEventWithMetadata<OverdueCheckNotificationKey>> notificationsForKey = getNotificationsForOverdueable(account);
Assert.assertEquals(notificationsForKey.size(), 1);
final NotificationEventWithMetadata nm = notificationsForKey.get(0);
Assert.assertEquals(nm.getEvent(), notificationKey);
Assert.assertEquals(nm.getEffectiveDate().compareTo(testReferenceTime.plusDays(expectedNbDaysInFuture)), 0);
}
代码示例来源:origin: killbill/killbill
private void clearWithLock(final DateTime effectiveDate, final InternalCallContext context) throws OverdueException, OverdueApiException {
final BlockingState blockingStateForService = api.getBlockingStateForService(overdueable.getId(), BlockingStateType.ACCOUNT, OverdueService.OVERDUE_SERVICE_NAME, context);
final String previousOverdueStateName = blockingStateForService != null ? blockingStateForService.getStateName() : OverdueWrapper.CLEAR_STATE_NAME;
final OverdueState previousOverdueState = overdueStateSet.findState(previousOverdueStateName);
overdueStateApplicator.clear(effectiveDate, overdueable, previousOverdueState, overdueStateSet.getClearState(), context);
}
代码示例来源:origin: killbill/killbill
protected Account createAccount(final AccountData accountData) throws AccountApiException {
final Account account = accountUserApi.createAccount(accountData, callContext);
refreshCallContext(account.getId());
return account;
}
代码示例来源:origin: killbill/killbill
public DefaultImmutableAccountData(final Account account) {
this(account.getId(),
account.getExternalKey(),
account.getCurrency(),
account.getTimeZone(),
AccountDateTimeUtils.getFixedOffsetTimeZone(account),
account.getReferenceTime());
}
代码示例来源:origin: killbill/killbill
protected Account createAccount(final AccountData accountData) throws AccountApiException {
final Account account = accountUserApi.createAccount(accountData, callContext);
refreshCallContext(account.getId());
return account;
}
}
代码示例来源:origin: killbill/killbill
@Test(groups = "slow")
public void testShouldntInsertMultipleNotificationsPerOverdueable() throws Exception {
final UUID accountId = UUID.randomUUID();
final Account overdueable = Mockito.mock(Account.class);
Mockito.when(overdueable.getId()).thenReturn(accountId);
insertOverdueCheckAndVerifyQueueContent(overdueable, 10, 10);
insertOverdueCheckAndVerifyQueueContent(overdueable, 5, 5);
insertOverdueCheckAndVerifyQueueContent(overdueable, 15, 5);
// Verify the final content of the queue
Assert.assertEquals(Iterables.size(overdueQueue.getFutureNotificationForSearchKeys(internalCallContext.getAccountRecordId(), internalCallContext.getTenantRecordId())), 1);
}
代码示例来源:origin: killbill/killbill
protected Account getAccountByKey(final String key, final InternalTenantContext context) throws AccountApiException {
final AccountModelDao accountModelDao = accountDao.getAccountByKey(key, context);
if (accountModelDao == null) {
throw new AccountApiException(ErrorCode.ACCOUNT_DOES_NOT_EXIST_FOR_KEY, key);
}
final Account account = new DefaultAccount(accountModelDao);
final Long recordId = nonEntityDao.retrieveRecordIdFromObject(account.getId(), ObjectType.ACCOUNT, recordIdCacheController);
accountCacheController.putIfAbsent(recordId, new DefaultImmutableAccountData(account));
return account;
}
代码示例来源:origin: killbill/killbill
@Test(groups = "slow", expectedExceptions = IllegalArgumentException.class, description = "Test updating Account externalKey throws an exception")
public void testShouldntBeAbleToUpdateExternalKey() throws Exception {
final Account account = createAccount(new DefaultAccount(createTestAccount()));
final MutableAccountData otherAccount = new DefaultAccount(account.getId(), account).toMutableAccountData();
otherAccount.setExternalKey(UUID.randomUUID().toString());
accountUserApi.updateAccount(new DefaultAccount(account.getId(), otherAccount), callContext);
}
代码示例来源:origin: killbill/killbill
@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);
}
代码示例来源:origin: killbill/killbill
@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);
}
代码示例来源:origin: killbill/killbill
@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);
}
代码示例来源:origin: killbill/killbill
@Test(groups = "slow", description = "Test failure on resetting BCD", expectedExceptions = IllegalArgumentException.class)
public void testAccountResetBCD() throws Exception {
final Account account = createAccount(new DefaultAccount(createTestAccount()));
// Update the address and leave other fields null
final MutableAccountData mutableAccountData = new DefaultMutableAccountData(account);
mutableAccountData.setBillCycleDayLocal(DEFAULT_BILLING_CYCLE_DAY_LOCAL);
DefaultAccount newAccount = new DefaultAccount(account.getId(), mutableAccountData);
accountUserApi.updateAccount(newAccount, callContext);
}
代码示例来源:origin: killbill/killbill
@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);
}
代码示例来源:origin: killbill/killbill
@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);
}
代码示例来源:origin: killbill/killbill
@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);
}
代码示例来源:origin: killbill/killbill
@Test(groups = "slow", description = "Test failure on changing currency", expectedExceptions = IllegalArgumentException.class)
public void testAccountChangeCurrency() 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(Currency.AFN);
DefaultAccount newAccount = new DefaultAccount(account.getId(), mutableAccountData);
accountUserApi.updateAccount(newAccount, callContext);
}
代码示例来源:origin: killbill/killbill
@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);
}
内容来源于网络,如有侵权,请联系作者删除!