Tabnine Logo
Account.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
org.killbill.billing.account.api.Account

Best Java code snippets using org.killbill.billing.account.api.Account.getId (Showing top 20 results out of 315)

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);
}
org.killbill.billing.account.apiAccountgetId

Popular methods of Account

  • getExternalKey
  • getTimeZone
  • getEmail
  • getName
  • getCurrency
  • getFirstNameLength
  • getPhone
  • getReferenceTime
  • getBillCycleDayLocal
  • getLocale
  • getParentAccountId
  • getPaymentMethodId
  • getParentAccountId,
  • getPaymentMethodId,
  • isPaymentDelegatedToParent,
  • getAddress1,
  • getAddress2,
  • getCity,
  • getCompanyName,
  • getCountry,
  • getPostalCode

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • onRequestPermissionsResult (Fragment)
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • JComboBox (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now