use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validRevolut_returnsCreatedAccount.
@InSequence(2)
@Test
public void create_validRevolut_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final RevolutPaymentAccount accountToCreate = new RevolutPaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.accountId = faker.idNumber().valid();
final String expectedPaymentDetails = String.format("Revolut - Account:%s", accountToCreate.accountId);
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("accountId", equalTo(accountToCreate.accountId)).and().body("size()", equalTo(7));
}
use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validUSPostalMoneyOrder_returnsCreatedAccount.
@InSequence(2)
@Test
public void create_validUSPostalMoneyOrder_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final USPostalMoneyOrderPaymentAccount accountToCreate = new USPostalMoneyOrderPaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.holderName = faker.name().fullName();
accountToCreate.postalAddress = faker.address().fullAddress();
final String expectedPaymentDetails = String.format("US Postal Money Order - Holder name: %s, postal address: %s", accountToCreate.holderName, accountToCreate.postalAddress);
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("postalAddress", equalTo(accountToCreate.postalAddress)).and().body("size()", equalTo(8));
}
use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validClearXchange_returnsCreatedAccount.
@InSequence(2)
@Test
public void create_validClearXchange_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final ClearXchangePaymentAccount accountToCreate = new ClearXchangePaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.emailOrMobileNr = faker.internet().emailAddress();
accountToCreate.holderName = faker.name().fullName();
final String expectedPaymentDetails = String.format("Zelle (ClearXchange) - Holder name: %s, Email or mobile no.: %s", accountToCreate.holderName, accountToCreate.emailOrMobileNr);
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("size()", equalTo(8));
}
use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validUphold_returnsCreatedAccount.
@InSequence(2)
@Test
public void create_validUphold_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final UpholdPaymentAccount accountToCreate = new UpholdPaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.accountId = faker.idNumber().valid();
final String expectedPaymentDetails = String.format("Uphold - Account: %s", accountToCreate.accountId);
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("accountId", equalTo(accountToCreate.accountId)).and().body("size()", equalTo(7));
}
use of com.github.javafaker.Faker in project bisq-api by mrosseel.
the class PaymentAccountIT method create_validAliPay_returnsCreatedAccount.
@InSequence(1)
@Test
public void create_validAliPay_returnsCreatedAccount() {
final int alicePort = getAlicePort();
final Faker faker = new Faker();
final AliPayPaymentAccount accountToCreate = new AliPayPaymentAccount();
ApiTestHelper.randomizeAccountPayload(accountToCreate);
accountToCreate.accountNr = faker.finance().iban();
final String expectedPaymentDetails = String.format("AliPay - 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));
}
Aggregations