private void createAccountAndRefreshTimeAwareContext(final DateTimeZone dateTimeZone, final DateTime referenceDateTime) throws AccountApiException { final Account accountData = new MockAccountBuilder().externalKey(UUID.randomUUID().toString()) .timeZone(dateTimeZone) .createdDate(referenceDateTime) .build(); GuicyKillbillTestSuiteNoDB.createMockAccount(accountData, accountUserApi, accountInternalApi, immutableAccountInternalApi, nonEntityDao, clock, internalCallContextFactory, callContext, internalCallContext); } }
private void refreshCallContext(final DateTime effectiveDateTime, final DateTimeZone timeZone) { final Account account = new MockAccountBuilder().timeZone(timeZone) .createdDate(effectiveDateTime) .referenceTime(effectiveDateTime) .build(); internalCallContext.setFixedOffsetTimeZone(AccountDateTimeUtils.getFixedOffsetTimeZone(account)); internalCallContext.setReferenceTime(account.getReferenceTime()); } }
if (data instanceof Account) { this.id = ((Account) data).getId(); this.createdDate(((Account) data).getCreatedDate()); this.updatedDate(((Account) data).getUpdatedDate()); } else {
private void createAccountAndRefreshTimeAwareContext(final DateTimeZone dateTimeZone, final DateTime referenceDateTime) throws AccountApiException { final Account accountData = new MockAccountBuilder().externalKey(UUID.randomUUID().toString()) .timeZone(dateTimeZone) .createdDate(referenceDateTime) .build(); GuicyKillbillTestSuiteNoDB.createMockAccount(accountData, accountUserApi, accountInternalApi, immutableAccountInternalApi, nonEntityDao, clock, internalCallContextFactory, callContext, internalCallContext); } }
private void createAccount(final DateTimeZone dateTimeZone, final DateTime referenceDateTime) throws AccountApiException { final Account accountData = new MockAccountBuilder().externalKey(UUID.randomUUID().toString()) .timeZone(dateTimeZone) .referenceTime(referenceDateTime) .createdDate(referenceDateTime) .build(); GuicyKillbillTestSuiteNoDB.createMockAccount(accountData, accountUserApi, accountInternalApi, immutableAccountInternalApi, nonEntityDao, clock, internalCallContextFactory, callContext, internalCallContext); } }
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; }
private void refreshCallContext(final DateTime effectiveDateTime, final DateTimeZone timeZone) { final Account account = new MockAccountBuilder().timeZone(timeZone) .createdDate(effectiveDateTime) .referenceTime(effectiveDateTime) .build(); internalCallContext.setFixedOffsetTimeZone(AccountDateTimeUtils.getFixedOffsetTimeZone(account)); internalCallContext.setReferenceTime(account.getReferenceTime()); } }
if (data instanceof Account) { this.id = ((Account) data).getId(); this.createdDate(((Account) data).getCreatedDate()); this.updatedDate(((Account) data).getUpdatedDate()); } else {