Search in sources :

Example 26 with Faker

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));
}
Also used : Faker(com.github.javafaker.Faker) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 27 with Faker

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));
}
Also used : Faker(com.github.javafaker.Faker) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 28 with Faker

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));
}
Also used : Faker(com.github.javafaker.Faker) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 29 with Faker

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));
}
Also used : Faker(com.github.javafaker.Faker) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 30 with Faker

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));
}
Also used : Faker(com.github.javafaker.Faker) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Aggregations

Faker (com.github.javafaker.Faker)31 Test (org.junit.Test)26 InSequence (org.jboss.arquillian.junit.InSequence)21 Locale (java.util.Locale)4 Gson (com.google.gson.Gson)3 HashMap (java.util.HashMap)3 AccessToken (com.twilio.jwt.accesstoken.AccessToken)2 AbstractFakerTest (com.github.javafaker.AbstractFakerTest)1 IpMessagingGrant (com.twilio.jwt.accesstoken.IpMessagingGrant)1 AccessToken (com.twilio.sdk.auth.AccessToken)1 VideoGrant (com.twilio.sdk.auth.VideoGrant)1 io.bisq.api.model.payment (io.bisq.api.model.payment)1 SepaPaymentAccount (io.bisq.api.model.payment.SepaPaymentAccount)1 CountryUtil (io.bisq.common.locale.CountryUtil)1 RestAssured.given (io.restassured.RestAssured.given)1 ContentType (io.restassured.http.ContentType)1 Path (java.nio.file.Path)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 List (java.util.List)1