use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validNationalBankAccount_returnsCreatedAccount.
@InSequence(2)
@Test
public void create_validNationalBankAccount_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final NationalBankAccountPaymentAccount accountToCreate = new NationalBankAccountPaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.accountNr = faker.finance().iban();
accountToCreate.accountType = faker.options().option("savings", "avista");
accountToCreate.bankId = faker.finance().bic();
accountToCreate.bankName = faker.company().name();
accountToCreate.branchId = faker.company().buzzword();
accountToCreate.countryCode = faker.address().countryCode();
accountToCreate.holderName = faker.name().fullName();
accountToCreate.holderTaxId = faker.finance().creditCard();
final String expectedPaymentDetails = String.format("National Bank transfer - Holder name: %s, Bank name: %s, Bank ID (BIC/SWIFT): %s, Branch no.: %s, Account no. (IBAN): %s, Country of bank: %s", accountToCreate.holderName, accountToCreate.bankName, accountToCreate.bankId, accountToCreate.branchId, accountToCreate.accountNr, CountryUtil.getNameByCode(accountToCreate.countryCode));
given().port(alicePort).contentType(ContentType.JSON).body(accountToCreate).when().post("/api/v1/payment-accounts").then().statusCode(200).and().body("id", isA(String.class)).and().body("paymentMethod", equalTo(accountToCreate.paymentMethod)).and().body("accountName", equalTo(accountToCreate.accountName)).and().body("paymentDetails", equalTo(expectedPaymentDetails)).and().body("selectedTradeCurrency", equalTo(accountToCreate.selectedTradeCurrency)).and().body("tradeCurrencies", equalTo(accountToCreate.tradeCurrencies)).and().body("accountNr", equalTo(accountToCreate.accountNr)).and().body("accountType", equalTo(accountToCreate.accountType)).and().body("bankId", equalTo(accountToCreate.bankId)).and().body("bankName", equalTo(accountToCreate.bankName)).and().body("branchId", equalTo(accountToCreate.branchId)).and().body("countryCode", equalTo(accountToCreate.countryCode)).and().body("holderName", equalTo(accountToCreate.holderName)).and().body("holderTaxId", equalTo(accountToCreate.holderTaxId)).and().body("size()", equalTo(14));
}
use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validCashDeposit_returnsCreatedAccount.
@InSequence(2)
@Test
public void create_validCashDeposit_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final CashDepositPaymentAccount accountToCreate = new CashDepositPaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.accountNr = faker.finance().iban();
accountToCreate.accountType = faker.options().option("savings", "avista");
accountToCreate.bankId = faker.finance().bic();
accountToCreate.bankName = faker.company().name();
accountToCreate.branchId = faker.company().buzzword();
accountToCreate.countryCode = faker.address().countryCode();
accountToCreate.holderEmail = faker.internet().emailAddress();
accountToCreate.holderName = faker.name().fullName();
accountToCreate.holderTaxId = faker.finance().creditCard();
accountToCreate.requirements = faker.witcher().quote();
given().port(alicePort).contentType(ContentType.JSON).body(accountToCreate).when().post("/api/v1/payment-accounts").then().statusCode(200).and().body("id", isA(String.class)).and().body("paymentMethod", equalTo(accountToCreate.paymentMethod)).and().body("accountName", equalTo(accountToCreate.accountName)).and().body("paymentDetails", isA(String.class)).and().body("selectedTradeCurrency", equalTo(accountToCreate.selectedTradeCurrency)).and().body("tradeCurrencies", equalTo(accountToCreate.tradeCurrencies)).and().body("accountNr", equalTo(accountToCreate.accountNr)).and().body("accountType", equalTo(accountToCreate.accountType)).and().body("bankId", equalTo(accountToCreate.bankId)).and().body("bankName", equalTo(accountToCreate.bankName)).and().body("branchId", equalTo(accountToCreate.branchId)).and().body("countryCode", equalTo(accountToCreate.countryCode)).and().body("holderName", equalTo(accountToCreate.holderName)).and().body("holderEmail", equalTo(accountToCreate.holderEmail)).and().body("holderTaxId", equalTo(accountToCreate.holderTaxId)).and().body("requirements", equalTo(accountToCreate.requirements)).and().body("size()", equalTo(16));
}
use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validPerfectMoney_returnsCreatedAccount.
@InSequence(2)
@Test
public void create_validPerfectMoney_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final PerfectMoneyPaymentAccount accountToCreate = new PerfectMoneyPaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.accountNr = faker.idNumber().valid();
final String expectedPaymentDetails = String.format("PerfectMoney - Account no.: %s", accountToCreate.accountNr);
given().port(alicePort).contentType(ContentType.JSON).body(accountToCreate).when().post("/api/v1/payment-accounts").then().statusCode(200).and().body("id", isA(String.class)).and().body("paymentMethod", equalTo(accountToCreate.paymentMethod)).and().body("accountName", equalTo(accountToCreate.accountName)).and().body("paymentDetails", equalTo(expectedPaymentDetails)).and().body("selectedTradeCurrency", equalTo(accountToCreate.selectedTradeCurrency)).and().body("tradeCurrencies", equalTo(accountToCreate.tradeCurrencies)).and().body("accountNr", equalTo(accountToCreate.accountNr)).and().body("size()", equalTo(7));
}
use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validWesternUnion_returnsCreatedAccount.
@InSequence(2)
@Test
public void create_validWesternUnion_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final WesternUnionPaymentAccount accountToCreate = new WesternUnionPaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.holderName = faker.name().fullName();
accountToCreate.city = faker.address().city();
accountToCreate.countryCode = faker.address().countryCode();
accountToCreate.email = faker.internet().emailAddress();
accountToCreate.state = faker.address().state();
final String expectedPaymentDetails = String.format("Western Union - Full name: %s, City: %s, County: %s, Email: %s", accountToCreate.holderName, accountToCreate.city, CountryUtil.getNameByCode(accountToCreate.countryCode), accountToCreate.email);
given().port(alicePort).contentType(ContentType.JSON).body(accountToCreate).when().post("/api/v1/payment-accounts").then().statusCode(200).and().body("id", isA(String.class)).and().body("paymentMethod", equalTo(accountToCreate.paymentMethod)).and().body("accountName", equalTo(accountToCreate.accountName)).and().body("paymentDetails", equalTo(expectedPaymentDetails)).and().body("selectedTradeCurrency", equalTo(accountToCreate.selectedTradeCurrency)).and().body("tradeCurrencies", equalTo(accountToCreate.tradeCurrencies)).and().body("holderName", equalTo(accountToCreate.holderName)).and().body("city", equalTo(accountToCreate.city)).and().body("countryCode", equalTo(accountToCreate.countryCode)).and().body("email", equalTo(accountToCreate.email)).and().body("state", equalTo(accountToCreate.state)).and().body("size()", equalTo(11));
}
use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validInteracETransfer_returnsCreatedAccount.
@InSequence(2)
@Test
public void create_validInteracETransfer_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final InteracETransferPaymentAccount accountToCreate = new InteracETransferPaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.emailOrMobileNr = faker.internet().emailAddress();
accountToCreate.holderName = faker.name().fullName();
accountToCreate.question = faker.witcher().quote();
accountToCreate.answer = faker.witcher().character();
final String expectedPaymentDetails = String.format("Interac e-Transfer - Holder name: %s, email: %s, secret question: %s, answer: %s", accountToCreate.holderName, accountToCreate.emailOrMobileNr, accountToCreate.question, accountToCreate.answer);
given().port(alicePort).contentType(ContentType.JSON).body(accountToCreate).when().post("/api/v1/payment-accounts").then().statusCode(200).and().body("id", isA(String.class)).and().body("paymentMethod", equalTo(accountToCreate.paymentMethod)).and().body("accountName", equalTo(accountToCreate.accountName)).and().body("paymentDetails", equalTo(expectedPaymentDetails)).and().body("selectedTradeCurrency", equalTo(accountToCreate.selectedTradeCurrency)).and().body("tradeCurrencies", equalTo(accountToCreate.tradeCurrencies)).and().body("emailOrMobileNr", equalTo(accountToCreate.emailOrMobileNr)).and().body("holderName", equalTo(accountToCreate.holderName)).and().body("question", equalTo(accountToCreate.question)).and().body("answer", equalTo(accountToCreate.answer)).and().body("size()", equalTo(10));
}
Aggregations