Search in sources :

Example 56 with InSequence

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

the class ArbitratorResourceIT method selectArbitrator.

@InSequence(4)
@Test
public void selectArbitrator() {
    final int alicePort = getAlicePort();
    final String arbitratorAddress = getArbitratorAddress(alicePort);
    assertNumberOfAcceptedArbitrators(alicePort, 0);
    given().port(alicePort).pathParam("address", arbitratorAddress).when().post("/api/v1/arbitrators/{address}/select").then().statusCode(200).and().body("arbitrators.size()", equalTo(1)).and().body("total", equalTo(1));
    assertNumberOfAcceptedArbitrators(alicePort, 1);
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 57 with InSequence

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

the class ArbitratorResourceIT method deselectArbitrator.

/**
 * Deselect test goes before select test because by default arbitrators are auto selected when registered
 */
@InSequence(3)
@Test
public void deselectArbitrator() {
    final int alicePort = getAlicePort();
    final String arbitratorAddress = getArbitratorAddress(alicePort);
    assertNumberOfAcceptedArbitrators(alicePort, 1);
    given().port(alicePort).pathParam("address", arbitratorAddress).when().post("/api/v1/arbitrators/{address}/deselect").then().statusCode(200).and().body("arbitrators.size()", equalTo(0)).and().body("total", equalTo(0));
    assertNumberOfAcceptedArbitrators(alicePort, 0);
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 58 with InSequence

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

the class OfferResourceIT method createOffer_notUseMarketBasePriceButNoFixedPrice_returns422status.

@InSequence(3)
@Test
public void createOffer_notUseMarketBasePriceButNoFixedPrice_returns422status() {
    final OfferToCreate offer = getOfferToCreateFixedBuy(tradeCurrency, alicePaymentAccount.id);
    offer.priceType = PriceType.FIXED;
    final JSONObject jsonOffer = toJsonObject(offer);
    jsonOffer.remove("fixedPrice");
    given().port(getAlicePort()).body(jsonOffer.toString()).contentType(ContentType.JSON).when().post("/api/v1/offers").then().statusCode(422);
}
Also used : JSONObject(org.json.simple.JSONObject) OfferToCreate(io.bisq.api.model.OfferToCreate) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 59 with InSequence

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

the class OfferResourceIT method takeOffer_amountMissing_returns422.

@InSequence(7)
@Test
public void takeOffer_amountMissing_returns422() throws Exception {
    final TakeOffer payload = new TakeOffer(bobPaymentAccount.id, null);
    takeOffer_template(createdOffer.id, payload, 422);
}
Also used : TakeOffer(io.bisq.api.model.TakeOffer) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Example 60 with InSequence

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

the class OfferResourceIT method createOffer_validPayloadButNoFunds_returns427status.

@InSequence(3)
@Test
public void createOffer_validPayloadButNoFunds_returns427status() {
    final OfferToCreate offer = getOfferToCreateFixedBuy(tradeCurrency, alicePaymentAccount.id);
    createOffer_template(offer, 427);
}
Also used : OfferToCreate(io.bisq.api.model.OfferToCreate) 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