public AccountData initAccountData(final Clock clock) { final AccountData accountData = new MockAccountBuilder().name(UUIDs.randomUUID().toString().substring(1, 8)) .firstNameLength(6) .email(UUIDs.randomUUID().toString().substring(1, 8)) .phone(UUIDs.randomUUID().toString().substring(1, 8)) .migrated(false) .externalKey(UUIDs.randomUUID().toString()) .billingCycleDayLocal(1) .currency(Currency.USD) .paymentMethodId(UUIDs.randomUUID()) .referenceTime(clock.getUTCNow()) .timeZone(DateTimeZone.forID("Europe/Paris")) .build(); assertNotNull(accountData); return accountData; }
.currency(currency) .billingCycleDayLocal(billCycleDayLocal) .paymentMethodId(paymentMethodId) .timeZone(timeZone) .locale(locale)
this.migrated(data.isMigrated()); this.name(data.getName()); this.paymentMethodId(data.getPaymentMethodId()); this.phone(data.getPhone()); this.notes(data.getNotes());
protected AccountData getAccountData(final int billingDay) { return new MockAccountBuilder().name(UUID.randomUUID().toString().substring(1, 8)) .firstNameLength(6) .email(UUID.randomUUID().toString().substring(1, 8)) .phone(UUID.randomUUID().toString().substring(1, 8)) .migrated(false) .externalKey(UUID.randomUUID().toString().substring(1, 8)) .billingCycleDayLocal(billingDay) .currency(Currency.USD) .paymentMethodId(UUID.randomUUID()) .referenceTime(clock.getUTCNow()) .timeZone(DateTimeZone.UTC) .build(); }
protected AccountData getChildAccountData(final int billingDay, final UUID parentAccountId, final boolean isPaymentDelegatedToParent) { return new MockAccountBuilder().name(UUID.randomUUID().toString().substring(1, 8)) .firstNameLength(6) .email(UUID.randomUUID().toString().substring(1, 8)) .phone(UUID.randomUUID().toString().substring(1, 8)) .migrated(false) .externalKey(UUID.randomUUID().toString().substring(1, 8)) .billingCycleDayLocal(billingDay) .currency(Currency.USD) .paymentMethodId(UUID.randomUUID()) .referenceTime(clock.getUTCNow()) .timeZone(DateTimeZone.UTC) .parentAccountId(parentAccountId) .isPaymentDelegatedToParent(isPaymentDelegatedToParent) .build(); }
@BeforeClass(groups = "fast") protected void beforeClass() throws Exception { if (hasFailed()) { return; } super.beforeClass(); final Clock clock = new DefaultClock(); this.account = new MockAccountBuilder().name(UUID.randomUUID().toString().substring(1, 8)) .firstNameLength(6) .email(UUID.randomUUID().toString().substring(1, 8)) .phone(UUID.randomUUID().toString().substring(1, 8)) .migrated(false) .externalKey(UUID.randomUUID().toString().substring(1, 8)) .billingCycleDayLocal(31) .currency(Currency.USD) .paymentMethodId(UUID.randomUUID()) .timeZone(DateTimeZone.UTC) .build(); }
public AccountData initAccountData(final Clock clock) { final AccountData accountData = new MockAccountBuilder().name(UUIDs.randomUUID().toString().substring(1, 8)) .firstNameLength(6) .email(UUIDs.randomUUID().toString().substring(1, 8)) .phone(UUIDs.randomUUID().toString().substring(1, 8)) .migrated(false) .externalKey(UUIDs.randomUUID().toString()) .billingCycleDayLocal(1) .currency(Currency.USD) .paymentMethodId(UUIDs.randomUUID()) .referenceTime(clock.getUTCNow()) .timeZone(DateTimeZone.forID("Europe/Paris")) .build(); assertNotNull(accountData); return accountData; }
public Account createAccount(final CallContext callContext) throws AccountApiException { final Account accountData = new MockAccountBuilder().name(UUID.randomUUID().toString().substring(1, 8)) .firstNameLength(6) .email(UUID.randomUUID().toString().substring(1, 8)) .phone(UUID.randomUUID().toString().substring(1, 8)) .migrated(false) .externalKey(UUID.randomUUID().toString().substring(1, 8)) .billingCycleDayLocal(31) .currency(accountCurrency) .paymentMethodId(UUID.randomUUID()) .timeZone(DateTimeZone.UTC) .createdDate(clock.getUTCNow()) .build(); final MutableCallContext mutableCallContext = new MutableCallContext(internalCallContext); final Account account; if (isFastTest()) { account = GuicyKillbillTestSuiteNoDB.createMockAccount(accountData, accountUserApi, accountApi, immutableAccountApi, nonEntityDao, clock, internalCallContextFactory, mutableCallContext, internalCallContext); } else { account = accountUserApi.createAccount(accountData, callContext); } GuicyKillbillTestSuite.refreshCallContext(account.getId(), clock, internalCallContextFactory, mutableCallContext, internalCallContext); return account; }
.billingCycleDayLocal(1) .currency(Currency.USD) .paymentMethodId(UUID.randomUUID()) .referenceTime(clock.getUTCNow()) .timeZone(tz)
.billingCycleDayLocal(1) .currency(Currency.USD) .paymentMethodId(UUID.randomUUID()) .referenceTime(clock.getUTCNow()) .timeZone(tz)
.billingCycleDayLocal(1) .currency(Currency.USD) .paymentMethodId(UUID.randomUUID()) .referenceTime(clock.getUTCNow()) .timeZone(tz)
.billingCycleDayLocal(1) .currency(Currency.USD) .paymentMethodId(UUID.randomUUID()) .referenceTime(clock.getUTCNow()) .timeZone(tz)
public UUID addTestPaymentMethod(final String pluginName, final Account account, final PaymentMethodPlugin paymentMethodInfo, final Iterable<PluginProperty> pluginProperties) throws Exception { final boolean setDefault = paymentMethodInfo.isDefaultPaymentMethod(); final UUID paymentMethodId = paymentApi.addPaymentMethod(account, paymentMethodInfo.getExternalPaymentMethodId(), pluginName, setDefault, paymentMethodInfo, pluginProperties, context); if (isFastTest() && setDefault) { final Account account1 = new MockAccountBuilder(account).paymentMethodId(paymentMethodId).build(); accountApi.updateAccount(account1, context); } return paymentMethodId; }
.currency(currency) .billingCycleDayLocal(billCycleDayLocal) .paymentMethodId(paymentMethodId) .timeZone(timeZone) .locale(locale)
this.migrated(data.isMigrated()); this.name(data.getName()); this.paymentMethodId(data.getPaymentMethodId()); this.phone(data.getPhone()); this.notes(data.getNotes());