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; }
.externalKey(externalKey) .email(email) .name(name).firstNameLength(firstNameLength) .currency(currency) .billingCycleDayLocal(billCycleDayLocal)
this.email(data.getEmail()); this.externalKey(data.getExternalKey()); this.firstNameLength(data.getFirstNameLength()); this.locale(data.getLocale()); this.migrated(data.isMigrated());
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 getAccountData(@Nullable final Integer billingDay, final DateTimeZone tz) { final MockAccountBuilder builder = 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)) .currency(Currency.USD) .referenceTime(clock.getUTCNow()) .timeZone(tz); if (billingDay != null) { builder.billingCycleDayLocal(billingDay); } return builder.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; }
.firstNameLength(6) .email(UUID.randomUUID().toString().substring(1, 8)) .phone(UUID.randomUUID().toString().substring(1, 8))
.firstNameLength(6) .email(UUID.randomUUID().toString().substring(1, 8)) .phone(UUID.randomUUID().toString().substring(1, 8))
.firstNameLength(6) .email(UUID.randomUUID().toString().substring(1, 8)) .phone(UUID.randomUUID().toString().substring(1, 8))
.firstNameLength(6) .email(UUID.randomUUID().toString().substring(1, 8)) .phone(UUID.randomUUID().toString().substring(1, 8))
.externalKey(externalKey) .email(email) .name(name).firstNameLength(firstNameLength) .currency(currency) .billingCycleDayLocal(billCycleDayLocal)
this.email(data.getEmail()); this.externalKey(data.getExternalKey()); this.firstNameLength(data.getFirstNameLength()); this.locale(data.getLocale()); this.migrated(data.isMigrated());