use of org.killbill.billing.mock.MockAccountBuilder in project killbill by killbill.
the class TestBillCycleDayCalculator method createAccountAndRefreshTimeAwareContext.
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);
}
use of org.killbill.billing.mock.MockAccountBuilder in project killbill by killbill.
the class TestTimeAwareContext method refreshCallContext.
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());
}
use of org.killbill.billing.mock.MockAccountBuilder in project killbill by killbill.
the class MockAccountUserApi method createAccountFromParams.
public Account createAccountFromParams(final UUID id, final String externalKey, final String email, final String name, final int firstNameLength, final Currency currency, final int billCycleDayLocal, final UUID paymentMethodId, final DateTimeZone timeZone, final String locale, final String address1, final String address2, final String companyName, final String city, final String stateOrProvince, final String country, final String postalCode, final String phone, final String notes) {
final Account result = new MockAccountBuilder(id).externalKey(externalKey).email(email).name(name).firstNameLength(firstNameLength).currency(currency).billingCycleDayLocal(billCycleDayLocal).paymentMethodId(paymentMethodId).timeZone(timeZone).locale(locale).address1(address1).address2(address2).companyName(companyName).city(city).stateOrProvince(stateOrProvince).country(country).postalCode(postalCode).phone(phone).notes(notes).build();
accounts.add(result);
return result;
}
use of org.killbill.billing.mock.MockAccountBuilder in project killbill by killbill.
the class MockAccountUserApi method createAccount.
@Override
public Account createAccount(final AccountData data, final CallContext context) throws AccountApiException {
final Account result = new MockAccountBuilder(data).build();
accounts.add(result);
return result;
}
use of org.killbill.billing.mock.MockAccountBuilder in project killbill by killbill.
the class TestPaymentHelper method addTestPaymentMethod.
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;
}
Aggregations