congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Account.getLocale
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: killbill/killbill

@Test(groups = "fast", description = "Test if Account constructor can accept null values")
public void testConstructorAcceptsNullValues() throws Exception {
  final AccountData accountData = getNullAccountData();
  final Account account = new DefaultAccount(UUID.randomUUID(), accountData);
  Assert.assertNull(account.getExternalKey());
  Assert.assertNull(account.getEmail());
  Assert.assertNull(account.getName());
  Assert.assertNull(account.getFirstNameLength());
  Assert.assertNull(account.getCurrency());
  Assert.assertEquals(account.getBillCycleDayLocal(), (Integer) 0);
  Assert.assertNull(account.getPaymentMethodId());
  Assert.assertNull(account.getTimeZone());
  Assert.assertNull(account.getLocale());
  Assert.assertNull(account.getAddress1());
  Assert.assertNull(account.getAddress2());
  Assert.assertNull(account.getCompanyName());
  Assert.assertNull(account.getCity());
  Assert.assertNull(account.getStateOrProvince());
  Assert.assertNull(account.getCountry());
  Assert.assertNull(account.getPostalCode());
  Assert.assertNull(account.getPhone());
  Assert.assertNull(account.isMigrated());
}
origin: killbill/killbill

private void checkAccountEquals(final Account finalAccount, final Account delegateAccount) {
  Assert.assertEquals(finalAccount.getExternalKey(), delegateAccount.getExternalKey());
  Assert.assertEquals(finalAccount.getEmail(), delegateAccount.getEmail());
  Assert.assertEquals(finalAccount.getName(), delegateAccount.getName());
  Assert.assertEquals(finalAccount.getFirstNameLength(), delegateAccount.getFirstNameLength());
  Assert.assertEquals(finalAccount.getCurrency(), delegateAccount.getCurrency());
  Assert.assertEquals(finalAccount.getBillCycleDayLocal(), delegateAccount.getBillCycleDayLocal());
  Assert.assertEquals(finalAccount.getPaymentMethodId(), delegateAccount.getPaymentMethodId());
  Assert.assertEquals(finalAccount.getTimeZone(), delegateAccount.getTimeZone());
  Assert.assertEquals(finalAccount.getLocale(), delegateAccount.getLocale());
  Assert.assertEquals(finalAccount.getAddress1(), delegateAccount.getAddress1());
  Assert.assertEquals(finalAccount.getAddress2(), delegateAccount.getAddress2());
  Assert.assertEquals(finalAccount.getCompanyName(), delegateAccount.getCompanyName());
  Assert.assertEquals(finalAccount.getCity(), delegateAccount.getCity());
  Assert.assertEquals(finalAccount.getStateOrProvince(), delegateAccount.getStateOrProvince());
  Assert.assertEquals(finalAccount.getCountry(), delegateAccount.getCountry());
  Assert.assertEquals(finalAccount.getPostalCode(), delegateAccount.getPostalCode());
  Assert.assertEquals(finalAccount.getPhone(), delegateAccount.getPhone());
  Assert.assertEquals(finalAccount.getNotes(), delegateAccount.getNotes());
  Assert.assertEquals(finalAccount.isMigrated(), delegateAccount.isMigrated());
}
origin: killbill/killbill

Assert.assertEquals(updatedAccount2.getPaymentMethodId(), updatedAccount1.getPaymentMethodId());
Assert.assertEquals(updatedAccount2.getTimeZone(), updatedAccount1.getTimeZone());
Assert.assertEquals(updatedAccount2.getLocale(), updatedAccount1.getLocale());
Assert.assertEquals(updatedAccount2.getAddress1(), updatedAccount1.getAddress1());
Assert.assertEquals(updatedAccount2.getAddress2(), updatedAccount1.getAddress2());
origin: killbill/killbill

Assert.assertEquals(retrievedAccount.getPaymentMethodId(), account.getPaymentMethodId());
Assert.assertEquals(retrievedAccount.getTimeZone(), account.getTimeZone());
Assert.assertEquals(retrievedAccount.getLocale(), account.getLocale());
Assert.assertEquals(retrievedAccount.getAddress1(), account.getAddress1());
Assert.assertEquals(retrievedAccount.getAddress2(), account.getAddress2());
origin: killbill/killbill

accountData.setLocale(locale != null ? locale : currentAccount.getLocale());
accountData.setAddress1(address1 != null ? address1 : currentAccount.getAddress1());
accountData.setAddress2(address2 != null ? address2 : currentAccount.getAddress2());
origin: org.kill-bill.billing/killbill-invoice

public HtmlInvoice generateInvoice(final Account account, @Nullable final Invoice invoice, final boolean manualPay, final InternalTenantContext context) throws IOException {
  // Don't do anything if the invoice is null
  if (invoice == null) {
    return null;
  }
  final String accountLocale = Strings.emptyToNull(account.getLocale());
  final Locale locale = accountLocale == null ? Locale.getDefault() : LocaleUtils.toLocale(accountLocale);
  final HtmlInvoice invoiceData = new HtmlInvoice();
  final Map<String, Object> data = new HashMap<String, Object>();
  final ResourceBundle invoiceBundle = accountLocale != null ?
                     bundleFactory.createBundle(LocaleUtils.toLocale(accountLocale), config.getInvoiceTemplateBundlePath(), ResourceBundleType.INVOICE_TRANSLATION, context) : null;
  final ResourceBundle defaultInvoiceBundle = bundleFactory.createBundle(Locale.getDefault(), config.getInvoiceTemplateBundlePath(), ResourceBundleType.INVOICE_TRANSLATION, context);
  final DefaultInvoiceTranslator invoiceTranslator = new DefaultInvoiceTranslator(invoiceBundle, defaultInvoiceBundle);
  data.put("text", invoiceTranslator);
  data.put("account", account);
  final InvoiceFormatter formattedInvoice = factory.createInvoiceFormatter(config, invoice, locale, currencyConversionApi, bundleFactory, context);
  data.put("invoice", formattedInvoice);
  invoiceData.setSubject(invoiceTranslator.getInvoiceEmailSubject());
  final String templateText = getTemplateText(locale, manualPay, context);
  invoiceData.setBody(templateEngine.executeTemplateText(templateText, data));
  return invoiceData;
}
origin: org.kill-bill.billing/killbill-invoice

private Account createAccount() {
  final Account account = Mockito.mock(Account.class);
  Mockito.when(account.getExternalKey()).thenReturn("1234abcd");
  Mockito.when(account.getName()).thenReturn("Jim Smith");
  Mockito.when(account.getFirstNameLength()).thenReturn(3);
  Mockito.when(account.getEmail()).thenReturn("jim.smith@mail.com");
  Mockito.when(account.getLocale()).thenReturn(Locale.US.toString());
  Mockito.when(account.getAddress1()).thenReturn("123 Some Street");
  Mockito.when(account.getAddress2()).thenReturn("Apt 456");
  Mockito.when(account.getCity()).thenReturn("Some City");
  Mockito.when(account.getStateOrProvince()).thenReturn("Some State");
  Mockito.when(account.getPostalCode()).thenReturn("12345-6789");
  Mockito.when(account.getCountry()).thenReturn("USA");
  Mockito.when(account.getPhone()).thenReturn("123-456-7890");
  return account;
}
origin: org.kill-bill.billing.plugin.java/killbill-base-plugin

public static Account buildAccount(final Currency currency, final String address1, final String address2, final String city, final String stateOrProvince, final String postalCode, final String country) {
  final Account account = Mockito.mock(Account.class);
  Mockito.when(account.getId()).thenReturn(UUID.randomUUID());
  Mockito.when(account.getExternalKey()).thenReturn(UUID.randomUUID().toString());
  Mockito.when(account.getName()).thenReturn(UUID.randomUUID().toString());
  Mockito.when(account.getFirstNameLength()).thenReturn(4);
  Mockito.when(account.getEmail()).thenReturn(UUID.randomUUID().toString());
  Mockito.when(account.getBillCycleDayLocal()).thenReturn(2);
  Mockito.when(account.getCurrency()).thenReturn(currency);
  Mockito.when(account.getPaymentMethodId()).thenReturn(UUID.randomUUID());
  Mockito.when(account.getTimeZone()).thenReturn(DateTimeZone.getDefault());
  // Return language tag to be able to use Locale.forLanguageTag
  Mockito.when(account.getLocale()).thenReturn("en-US");
  Mockito.when(account.getAddress1()).thenReturn(address1);
  Mockito.when(account.getAddress2()).thenReturn(address2);
  Mockito.when(account.getCompanyName()).thenReturn(UUID.randomUUID().toString());
  Mockito.when(account.getCity()).thenReturn(city);
  Mockito.when(account.getStateOrProvince()).thenReturn(stateOrProvince);
  Mockito.when(account.getPostalCode()).thenReturn(postalCode);
  Mockito.when(account.getCountry()).thenReturn(country);
  Mockito.when(account.getPhone()).thenReturn(UUID.randomUUID().toString().substring(0, 25));
  Mockito.when(account.isMigrated()).thenReturn(true);
  Mockito.when(account.getCreatedDate()).thenReturn(new DateTime(2016, 1, 22, 10, 56, 47, DateTimeZone.UTC));
  Mockito.when(account.getUpdatedDate()).thenReturn(new DateTime(2016, 1, 22, 10, 56, 48, DateTimeZone.UTC));
  return account;
}
origin: org.kill-bill.billing/killbill-jaxrs

public AccountJson(final Account account, final BigDecimal accountBalance, final BigDecimal accountCBA, @Nullable final AccountAuditLogs accountAuditLogs) {
  super(toAuditLogJson(accountAuditLogs == null ? null : accountAuditLogs.getAuditLogsForAccount()));
  this.accountCBA = accountCBA;
  this.accountBalance = accountBalance;
  this.accountId = account.getId();
  this.externalKey = account.getExternalKey();
  this.name = account.getName();
  this.firstNameLength = account.getFirstNameLength();
  this.email = account.getEmail();
  this.billCycleDayLocal = account.getBillCycleDayLocal();
  this.currency = account.getCurrency();
  this.parentAccountId = account.getParentAccountId();
  this.isPaymentDelegatedToParent = account.isPaymentDelegatedToParent();
  this.paymentMethodId = account.getPaymentMethodId();
  this.referenceTime = account.getReferenceTime();
  this.timeZone = account.getTimeZone() != null ? account.getTimeZone().toString() : null;
  this.address1 = account.getAddress1();
  this.address2 = account.getAddress2();
  this.postalCode = account.getPostalCode();
  this.company = account.getCompanyName();
  this.city = account.getCity();
  this.state = account.getStateOrProvince();
  this.country = account.getCountry();
  this.locale = account.getLocale();
  this.phone = account.getPhone();
  this.notes = account.getNotes();
  this.isMigrated = account.isMigrated();
}
origin: org.kill-bill.billing/killbill-account

accountData.setLocale(locale != null ? locale : currentAccount.getLocale());
accountData.setAddress1(address1 != null ? address1 : currentAccount.getAddress1());
accountData.setAddress2(address2 != null ? address2 : currentAccount.getAddress2());
org.killbill.billing.account.apiAccountgetLocale

Popular methods of Account

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

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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