Search in sources :

Example 66 with InSequence

use of org.jboss.arquillian.junit.InSequence in project bisq-api by mrosseel.

the class PaymentAccountIT method create_validMoneyBeam_returnsCreatedAccount.

@InSequence(2)
@Test
public void create_validMoneyBeam_returnsCreatedAccount() {
    final int alicePort = getAlicePort();
    final Faker faker = new Faker();
    final MoneyBeamPaymentAccount accountToCreate = new MoneyBeamPaymentAccount();
    ApiTestHelper.randomizeAccountPayload(accountToCreate);
    accountToCreate.accountId = faker.idNumber().valid();
    final String expectedPaymentDetails = String.format("MoneyBeam - 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 67 with InSequence

use of org.jboss.arquillian.junit.InSequence in project bisq-api by mrosseel.

the class PaymentAccountIT method create_validSameBankAccount_returnsCreatedAccount.

@InSequence(2)
@Test
public void create_validSameBankAccount_returnsCreatedAccount() {
    final int alicePort = getAlicePort();
    final Faker faker = new Faker();
    final SameBankAccountPaymentAccount accountToCreate = new SameBankAccountPaymentAccount();
    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("Transfer with same Bank - 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));
}
Also used : Faker(com.github.javafaker.Faker) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 68 with InSequence

use of org.jboss.arquillian.junit.InSequence in project bisq-api by mrosseel.

the class PaymentAccountIT method create_validSwish_returnsCreatedAccount.

@InSequence(2)
@Test
public void create_validSwish_returnsCreatedAccount() {
    final int alicePort = getAlicePort();
    final Faker faker = new Faker();
    final SwishPaymentAccount accountToCreate = new SwishPaymentAccount();
    ApiTestHelper.randomizeAccountPayload(accountToCreate);
    accountToCreate.holderName = faker.name().fullName();
    accountToCreate.mobileNr = faker.phoneNumber().cellPhone();
    final String expectedPaymentDetails = String.format("Swish - Holder name: %s, mobile no.: %s", accountToCreate.holderName, accountToCreate.mobileNr);
    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("mobileNr", equalTo(accountToCreate.mobileNr)).and().body("size()", equalTo(8));
}
Also used : Faker(com.github.javafaker.Faker) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 69 with InSequence

use of org.jboss.arquillian.junit.InSequence in project bisq-api by mrosseel.

the class PaymentAccountIT method create_validVenmo_returnsCreatedAccount.

@InSequence(2)
@Test
public void create_validVenmo_returnsCreatedAccount() {
    final int alicePort = getAlicePort();
    final Faker faker = new Faker();
    final VenmoPaymentAccount accountToCreate = new VenmoPaymentAccount();
    ApiTestHelper.randomizeAccountPayload(accountToCreate);
    accountToCreate.holderName = faker.name().fullName();
    accountToCreate.venmoUserName = faker.name().username();
    final String expectedPaymentDetails = String.format("Venmo - Holder name: %s, Venmo username: %s", accountToCreate.holderName, accountToCreate.venmoUserName);
    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("venmoUserName", equalTo(accountToCreate.venmoUserName)).and().body("size()", equalTo(8));
}
Also used : Faker(com.github.javafaker.Faker) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 70 with InSequence

use of org.jboss.arquillian.junit.InSequence in project bisq-api by mrosseel.

the class PaymentAccountIT method create_validOKPay_returnsCreatedAccount.

@InSequence(2)
@Test
public void create_validOKPay_returnsCreatedAccount() {
    final int alicePort = getAlicePort();
    final Faker faker = new Faker();
    final OKPayPaymentAccount accountToCreate = new OKPayPaymentAccount();
    ApiTestHelper.randomizeAccountPayload(accountToCreate);
    accountToCreate.accountNr = faker.idNumber().valid();
    final String expectedPaymentDetails = String.format("OKPay - 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

InSequence (org.jboss.arquillian.junit.InSequence)157 Test (org.junit.Test)157 Faker (com.github.javafaker.Faker)21 Simple (org.apache.deltaspike.data.test.ee7.domain.Simple)18 ModelNode (org.jboss.dmr.ModelNode)14 URL (java.net.URL)13 HttpResponse (org.apache.http.HttpResponse)10 TakeOffer (io.bisq.api.model.TakeOffer)9 HttpGet (org.apache.http.client.methods.HttpGet)8 ModelControllerClient (org.jboss.as.controller.client.ModelControllerClient)8 OfferToCreate (io.bisq.api.model.OfferToCreate)7 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)7 PartitionManager (org.picketlink.idm.PartitionManager)7 Response (javax.ws.rs.core.Response)6 IdentityManager (org.picketlink.idm.IdentityManager)6 StringTokenizer (java.util.StringTokenizer)5 RouteBuilder (org.apache.camel.builder.RouteBuilder)5 House (org.apache.deltaspike.data.test.ee7.domain.House)5 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)5 ManagementClient (org.jboss.as.arquillian.container.ManagementClient)5