use of com.consol.citrus.container.IteratingConditionExpression in project citrus-samples by christophd.
the class PlaceOrdersHttpIT method placeChocolateCookieOrder.
@CitrusTest
public void placeChocolateCookieOrder() {
variable("orderId", Functions.randomNumber(10L, null));
http().client(bakeryClient).send().post("/order").contentType(ContentType.APPLICATION_JSON.getMimeType()).payload("{ \"order\": { \"type\": \"chocolate\", \"id\": ${orderId}, \"amount\": 1}}");
repeatOnError().until(new IteratingConditionExpression() {
@Override
public boolean evaluate(int index, TestContext context) {
return index > 20;
}
}).autoSleep(100L).actions(http().client(reportingClient).send().get("/reporting/order").queryParam("id", "${orderId}"), http().client(reportingClient).receive().response(HttpStatus.OK).messageType(MessageType.JSON).payload("{\"status\": true}"));
http().client(bakeryClient).receive().response(HttpStatus.OK).messageType(MessageType.PLAINTEXT);
}
use of com.consol.citrus.container.IteratingConditionExpression in project citrus-samples by christophd.
the class PlaceOrdersJmsIT method placeChocolateCookieOrder.
@CitrusTest
public void placeChocolateCookieOrder() {
variable("orderId", Functions.randomNumber(10L, null));
send(bakeryOrderEndpoint).payload("<order><type>chocolate</type><id>${orderId}</id><amount>1</amount></order>");
repeatOnError().until(new IteratingConditionExpression() {
@Override
public boolean evaluate(int index, TestContext context) {
return index > 20;
}
}).autoSleep(100L).actions(http().client(reportingClient).send().get("/reporting/order").queryParam("id", "${orderId}"), http().client(reportingClient).receive().response(HttpStatus.OK).messageType(MessageType.JSON).payload("{\"status\": true}"));
}
use of com.consol.citrus.container.IteratingConditionExpression in project citrus-samples by christophd.
the class PlaceOrdersJmsIT method placeCaramelCookieOrder.
@CitrusTest
public void placeCaramelCookieOrder() {
variable("orderId", Functions.randomNumber(10L, null));
send(bakeryOrderEndpoint).payload("<order><type>caramel</type><id>${orderId}</id><amount>1</amount></order>");
repeatOnError().until(new IteratingConditionExpression() {
@Override
public boolean evaluate(int index, TestContext context) {
return index > 20;
}
}).autoSleep(100L).actions(http().client(reportingClient).send().get("/reporting/order").queryParam("id", "${orderId}"), http().client(reportingClient).receive().response(HttpStatus.OK).messageType(MessageType.JSON).payload("{\"status\": true}"));
}
use of com.consol.citrus.container.IteratingConditionExpression in project citrus-samples by christophd.
the class PlaceOrdersJmsIT method placeBlueberryCookieOrder.
@CitrusTest
public void placeBlueberryCookieOrder() {
variable("orderId", Functions.randomNumber(10L, null));
send(bakeryOrderEndpoint).payload("<order><type>blueberry</type><id>${orderId}</id><amount>1</amount></order>");
repeatOnError().until(new IteratingConditionExpression() {
@Override
public boolean evaluate(int index, TestContext context) {
return index > 20;
}
}).autoSleep(100L).actions(http().client(reportingClient).send().get("/reporting/order").queryParam("id", "${orderId}"), http().client(reportingClient).receive().response(HttpStatus.OK).messageType(MessageType.JSON).payload("{\"status\": true}"));
}
use of com.consol.citrus.container.IteratingConditionExpression in project citrus-samples by christophd.
the class PlaceOrdersHttpIT method placeCaramelCookieOrder.
@CitrusTest
public void placeCaramelCookieOrder() {
variable("orderId", Functions.randomNumber(10L, null));
http().client(bakeryClient).send().post("/order").contentType(ContentType.APPLICATION_JSON.getMimeType()).payload("{ \"order\": { \"type\": \"caramel\", \"id\": ${orderId}, \"amount\": 1}}");
repeatOnError().until(new IteratingConditionExpression() {
@Override
public boolean evaluate(int index, TestContext context) {
return index > 20;
}
}).autoSleep(100L).actions(http().client(reportingClient).send().get("/reporting/order").queryParam("id", "${orderId}"), http().client(reportingClient).receive().response(HttpStatus.OK).messageType(MessageType.JSON).payload("{\"status\": true}"));
http().client(bakeryClient).receive().response(HttpStatus.OK).messageType(MessageType.PLAINTEXT);
}
Aggregations