This is an automated email from the ASF dual-hosted git repository. mariofusco pushed a commit to branch q3lts in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-examples.git
commit 22f2041a28bcfec9106dd16cbee054533cc25fb2 Author: Toshiya Kobayashi <[email protected]> AuthorDate: Thu Nov 30 15:00:31 2023 +0900 Fix $.size() --- .../example/quarkus/ServiceDeskProcessTest.java | 2 +- .../src/test/java/org/acme/deals/DealsRestIT.java | 10 ++-- .../src/test/java/org/acme/deals/DealsRestIT.java | 10 ++-- .../src/test/java/org/acme/deals/DealsRestIT.java | 10 ++-- .../src/test/java/org/acme/deals/DealsRestIT.java | 10 ++-- .../java/org/kie/kogito/examples/OrdersRestIT.java | 36 ++++++------ .../org/kie/kogito/examples/PersonsRestIT.java | 64 +++++++++++----------- .../java/org/acme/travels/ApprovalsRestIT.java | 4 +- .../java/org/acme/travels/ApprovalsRestIT.java | 4 +- .../security/quarkus/ApprovalsRestTest.java | 4 +- .../example/springboot/ServiceDeskProcessTest.java | 2 +- .../src/test/java/org/acme/deals/DealsRestIT.java | 10 ++-- .../src/test/java/org/acme/deals/DealsRestIT.java | 10 ++-- .../examples/springboot/ProcessMetricsTest.java | 2 +- .../src/test/java/org/acme/deals/DealsRestIT.java | 10 ++-- .../org/kie/kogito/examples/demo/OrdersRestIT.java | 36 ++++++------ .../kie/kogito/examples/demo/PersonsRestIT.java | 64 +++++++++++----------- .../security/springboot/ApprovalsRestTest.java | 2 +- .../acme/sw/onboarding/resources/OnboardingIT.java | 2 +- 19 files changed, 146 insertions(+), 146 deletions(-) diff --git a/kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/kie/kogito/flexible/example/quarkus/ServiceDeskProcessTest.java b/kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/kie/kogito/flexible/example/quarkus/ServiceDeskProcessTest.java index b62b93dcd..768afb787 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/kie/kogito/flexible/example/quarkus/ServiceDeskProcessTest.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/kie/kogito/flexible/example/quarkus/ServiceDeskProcessTest.java @@ -168,7 +168,7 @@ class ServiceDeskProcessTest { .get("/tasks") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("Questionnaire")) .extract() .path("[0].id"); diff --git a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java index 7a47f5b54..716dec36b 100644 --- a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java +++ b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java @@ -55,7 +55,7 @@ public class DealsRestIT { given().accept(ContentType.JSON) .when().get("/deals") .then().statusCode(200) - .body("$.size()", is(1)) + .body("size()", is(1)) .body("[0].id", is(dealId)) .body("[0].name", is(deal)); @@ -68,7 +68,7 @@ public class DealsRestIT { String dealReviewId = given().accept(ContentType.JSON) .when().get("/dealreviews") .then().statusCode(200) - .body("$.size()", is(1)) + .body("size()", is(1)) .body("[0].id", notNullValue()) .body("[0].deal", is(deal)) .extract().path("[0].id"); @@ -77,7 +77,7 @@ public class DealsRestIT { String taskId = given().accept(ContentType.JSON) .when().get("/dealreviews/{uuid}/tasks?user=john", dealReviewId) .then().statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("review")) .body("[0].parameters.deal", is(deal)) .extract().path("[0].id"); @@ -93,12 +93,12 @@ public class DealsRestIT { //verify no deals to review given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().statusCode(200).body("$.size()", is(0)); + .then().statusCode(200).body("size()", is(0)); //verify no deals given().accept(ContentType.JSON) .when().get("/deals") - .then().statusCode(200).body("$.size()", is(0)); + .then().statusCode(200).body("size()", is(0)); } @Test diff --git a/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java b/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java index dc99788db..7b95f4226 100644 --- a/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java +++ b/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java @@ -49,7 +49,7 @@ public class DealsRestIT { given().accept(ContentType.JSON) .when().get("/deals") .then().statusCode(200) - .body("$.size()", is(1)) + .body("size()", is(1)) .body("[0].id", is(dealId)) .body("[0].name", is(deal)); @@ -62,7 +62,7 @@ public class DealsRestIT { String dealReviewId = given().accept(ContentType.JSON) .when().get("/dealreviews") .then().statusCode(200) - .body("$.size()", is(1)) + .body("size()", is(1)) .body("[0].id", notNullValue()) .body("[0].deal", is(deal)) .extract().path("[0].id"); @@ -71,7 +71,7 @@ public class DealsRestIT { String taskId = given().accept(ContentType.JSON) .when().get("/dealreviews/{uuid}/tasks?user=john", dealReviewId) .then().statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("review")) .body("[0].parameters.deal", is(deal)) .extract().path("[0].id"); @@ -87,11 +87,11 @@ public class DealsRestIT { //verify no deals to review given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().statusCode(200).body("$.size()", is(0)); + .then().statusCode(200).body("size()", is(0)); //verify no deals given().accept(ContentType.JSON) .when().get("/deals") - .then().statusCode(200).body("$.size()", is(0)); + .then().statusCode(200).body("size()", is(0)); } } diff --git a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java index 543548055..bc9f960a2 100644 --- a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java +++ b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java @@ -45,7 +45,7 @@ public class DealsRestIT { // test getting the created deal given().accept(ContentType.JSON) .when().get("/deals") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1), "[0].id", is(dealId)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1), "[0].id", is(dealId)); // test getting order by id given().accept(ContentType.JSON) @@ -55,12 +55,12 @@ public class DealsRestIT { // get deals for review String dealReviewId = given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); // get task for john String taskId = given().accept(ContentType.JSON) .when().get("/dealreviews/{uuid}/tasks?user=john", dealReviewId) - .then().log().ifValidationFails().statusCode(200).body("$.size", is(1)).extract().path("[0].id"); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1)).extract().path("[0].id"); // complete review task given().contentType(ContentType.JSON).accept(ContentType.JSON).body("{\"review\" : \"very good work\"}") @@ -70,11 +70,11 @@ public class DealsRestIT { //verify no deals to review given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(0)); //verify no deals given().accept(ContentType.JSON) .when().get("/deals") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(0)); } } diff --git a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java index 8b3219c37..4b846116a 100644 --- a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java +++ b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/test/java/org/acme/deals/DealsRestIT.java @@ -42,7 +42,7 @@ public class DealsRestIT { // test getting the created deal given().accept(ContentType.JSON) .when().get("/deals") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1), "[0].id", is(dealId)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1), "[0].id", is(dealId)); // test getting order by id given().accept(ContentType.JSON) @@ -52,12 +52,12 @@ public class DealsRestIT { // get deals for review String dealReviewId = given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); // get task for john String taskId = given().accept(ContentType.JSON) .when().get("/dealreviews/{uuid}/tasks?user=john", dealReviewId) - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1)).extract().path("[0].id"); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1)).extract().path("[0].id"); // complete review task given().contentType(ContentType.JSON).accept(ContentType.JSON).body("{\"review\" : \"very good work\"}") @@ -67,11 +67,11 @@ public class DealsRestIT { //verify no deals to review given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(0)); //verify no deals given().accept(ContentType.JSON) .when().get("/deals") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(0)); } } diff --git a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersRestIT.java b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersRestIT.java index 87eedde3e..e41ff6123 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersRestIT.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersRestIT.java @@ -77,7 +77,7 @@ public class OrdersRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting order by id given() @@ -115,7 +115,7 @@ public class OrdersRestIT { .get("/orders") .then() .statusCode(200) - .body("$.size()", is(1), "[0].id", is(secondCreatedId)); + .body("size()", is(1), "[0].id", is(secondCreatedId)); // delete second before finishing given() @@ -131,7 +131,7 @@ public class OrdersRestIT { .get("/orders") .then() .statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -153,7 +153,7 @@ public class OrdersRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test retrieving error info using process management addon given().accept(ContentType.JSON).when().get("/management/processes/demo.orders/instances/" + firstCreatedId + "/error").then() @@ -174,7 +174,7 @@ public class OrdersRestIT { given().accept(ContentType.JSON).when().delete("/orders/" + firstCreatedId).then().statusCode(200); // get all orders make sure there is zero given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -188,7 +188,7 @@ public class OrdersRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting order by id given().accept(ContentType.JSON).when().get("/orders/" + firstCreatedId).then() @@ -196,7 +196,7 @@ public class OrdersRestIT { // test getting order items subprocess String orderItemsId = given().accept(ContentType.JSON).when().get("/orderItems").then().statusCode(200) - .body("$.size()", is(1)).extract().path("[0].id"); + .body("size()", is(1)).extract().path("[0].id"); // test getting order items by id given().accept(ContentType.JSON).when().get("/orderItems/" + orderItemsId).then() @@ -209,7 +209,7 @@ public class OrdersRestIT { .get("/orderItems/" + orderItemsId + "/tasks?user=john") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("Verify order")) .extract() .path("[0].id"); @@ -228,11 +228,11 @@ public class OrdersRestIT { // get all orders make sure there is zero given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); // get all order items make sure there is zero given().accept(ContentType.JSON).when().get("/orderItems").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -246,7 +246,7 @@ public class OrdersRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting order by id given().accept(ContentType.JSON).when().get("/orders/" + firstCreatedId).then() @@ -254,7 +254,7 @@ public class OrdersRestIT { // test getting order items subprocess String orderItemsId = given().accept(ContentType.JSON).when().get("/orderItems?businessKey=ORD-0001").then().statusCode(200) - .body("$.size()", is(1)).extract().path("[0].id"); + .body("size()", is(1)).extract().path("[0].id"); // test getting order items by id given().accept(ContentType.JSON).when().get("/orderItems/" + orderItemsId).then() @@ -267,7 +267,7 @@ public class OrdersRestIT { .get("/orderItems/" + orderItemsId + "/tasks?user=john") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("Verify order")); // test deleting order items @@ -275,11 +275,11 @@ public class OrdersRestIT { // get all orders make sure there is zero given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); // get all order items make sure there is zero given().accept(ContentType.JSON).when().get("/orderItems").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -293,7 +293,7 @@ public class OrdersRestIT { assertNotNull(id); // get all orders make sure there is one given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1)); + .body("size()", is(1)); // get order by its custom ID and test given().accept(ContentType.JSON).body(orderPayload).when().get("/orders/{id}", id).then() @@ -310,13 +310,13 @@ public class OrdersRestIT { // get all orders make sure there is one given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1)); + .body("size()", is(1)); // test deleting order items by custom ID given().accept(ContentType.JSON).when().delete("/orders/{id}", id).then().statusCode(200); // get all orders make sure there is zero given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } } diff --git a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonsRestIT.java b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonsRestIT.java index 7608d0ee7..9463b7ab6 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonsRestIT.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonsRestIT.java @@ -68,7 +68,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -82,7 +82,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting task String taskId = given() @@ -91,7 +91,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -108,7 +108,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -122,7 +122,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting task String taskInfo = given() @@ -131,7 +131,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -149,7 +149,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -163,7 +163,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting task with wrong user given() @@ -172,7 +172,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=john") .then() .statusCode(200) - .body("$.size", is(0)); + .body("size()", is(0)); String taskInfo = given() .accept(ContentType.JSON) @@ -180,7 +180,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -209,7 +209,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -223,7 +223,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting task String taskId = given() @@ -232,7 +232,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -252,7 +252,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } // Disabled until KOGITO-1787 is fixed @@ -272,7 +272,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); + .body("size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); // test getting task String taskInfo = given() @@ -281,7 +281,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -299,7 +299,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -316,7 +316,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); + .body("size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); // test getting task given() @@ -325,7 +325,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -336,7 +336,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -353,7 +353,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); + .body("size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); // test getting task String taskInfo = given() @@ -362,13 +362,13 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); String nodeInstanceId = given().contentType(ContentType.JSON).accept(ContentType.JSON).when().get("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances").then() - .statusCode(200).body("$.size()", is(1)).extract().path("[0].nodeInstanceId"); + .statusCode(200).body("size()", is(1)).extract().path("[0].nodeInstanceId"); // retrigger node instance via management interface given().contentType(ContentType.JSON).accept(ContentType.JSON).when().post("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances/" + nodeInstanceId).then() @@ -376,13 +376,13 @@ public class PersonsRestIT { taskInfo = given().accept(ContentType.JSON).when().get("/persons/" + firstCreatedId + "/tasks?user=admin").then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .extract() .path("[0].id"); String retriggeredNodeInstanceId = given().contentType(ContentType.JSON).accept(ContentType.JSON).when().get("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances").then() - .statusCode(200).body("$.size()", is(1)).extract().path("[0].nodeInstanceId"); + .statusCode(200).body("size()", is(1)).extract().path("[0].nodeInstanceId"); // since node instance was retriggered it must have different ids assertNotEquals(nodeInstanceId, retriggeredNodeInstanceId); @@ -399,7 +399,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -416,7 +416,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); + .body("size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); // test getting task String taskInfo = given() @@ -425,13 +425,13 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); String nodeInstanceId = given().contentType(ContentType.JSON).accept(ContentType.JSON).when().get("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances").then() - .statusCode(200).body("$.size()", is(1)).extract().path("[0].nodeInstanceId"); + .statusCode(200).body("size()", is(1)).extract().path("[0].nodeInstanceId"); // cancel node instance given().contentType(ContentType.JSON).accept(ContentType.JSON).when().delete("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances/" + nodeInstanceId).then() @@ -443,13 +443,13 @@ public class PersonsRestIT { taskInfo = given().accept(ContentType.JSON).when().get("/persons/" + firstCreatedId + "/tasks?user=admin").then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .extract() .path("[0].id"); String retriggeredNodeInstanceId = given().contentType(ContentType.JSON).accept(ContentType.JSON).when().get("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances").then() - .statusCode(200).body("$.size()", is(1)).extract().path("[0].nodeInstanceId"); + .statusCode(200).body("size()", is(1)).extract().path("[0].nodeInstanceId"); // since node instance was retriggered it must have different ids assertNotEquals(nodeInstanceId, retriggeredNodeInstanceId); @@ -466,7 +466,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } } diff --git a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus-with-console/src/test/java/org/acme/travels/ApprovalsRestIT.java b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus-with-console/src/test/java/org/acme/travels/ApprovalsRestIT.java index 491b04dcc..89e7dac36 100644 --- a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus-with-console/src/test/java/org/acme/travels/ApprovalsRestIT.java +++ b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus-with-console/src/test/java/org/acme/travels/ApprovalsRestIT.java @@ -74,7 +74,7 @@ public class ApprovalsRestIT { .get("/approvals") .then() .statusCode(200) - .body("$.size()", is(1), "[0].id", is(id)); + .body("size()", is(1), "[0].id", is(id)); // get just started approval given() @@ -96,7 +96,7 @@ public class ApprovalsRestIT { .get("/approvals/" + id + "/tasks?user=admin&group=managers") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("firstLineApproval")) .extract() .path("[0].id"); diff --git a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/test/java/org/acme/travels/ApprovalsRestIT.java b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/test/java/org/acme/travels/ApprovalsRestIT.java index 80280c74a..8ff564477 100644 --- a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/test/java/org/acme/travels/ApprovalsRestIT.java +++ b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/test/java/org/acme/travels/ApprovalsRestIT.java @@ -72,7 +72,7 @@ public class ApprovalsRestIT { .get("/approvals") .then() .statusCode(200) - .body("$.size()", is(1), "[0].id", is(id)); + .body("size()", is(1), "[0].id", is(id)); // get just started approval given() @@ -94,7 +94,7 @@ public class ApprovalsRestIT { .get("/approvals/" + id + "/tasks?user=admin&group=managers") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("firstLineApproval")) .extract() .path("[0].id"); diff --git a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/test/java/org/acme/travels/security/quarkus/ApprovalsRestTest.java b/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/test/java/org/acme/travels/security/quarkus/ApprovalsRestTest.java index 4294281ce..5478ab4c4 100644 --- a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/test/java/org/acme/travels/security/quarkus/ApprovalsRestTest.java +++ b/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/test/java/org/acme/travels/security/quarkus/ApprovalsRestTest.java @@ -64,7 +64,7 @@ public class ApprovalsRestTest { .get("/approvals") .then() .statusCode(200) - .body("$.size()", is(1), "[0].id", is(id)); + .body("size()", is(1), "[0].id", is(id)); // get just started approval given() @@ -85,7 +85,7 @@ public class ApprovalsRestTest { .get("/approvals/" + id + "/tasks?user=admin&group=managers") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("firstLineApproval")) .extract() .path("[0].id"); diff --git a/kogito-springboot-examples/flexible-process-springboot/src/test/java/org/kie/kogito/flexible/example/springboot/ServiceDeskProcessTest.java b/kogito-springboot-examples/flexible-process-springboot/src/test/java/org/kie/kogito/flexible/example/springboot/ServiceDeskProcessTest.java index 72870d4c7..250c92ee9 100644 --- a/kogito-springboot-examples/flexible-process-springboot/src/test/java/org/kie/kogito/flexible/example/springboot/ServiceDeskProcessTest.java +++ b/kogito-springboot-examples/flexible-process-springboot/src/test/java/org/kie/kogito/flexible/example/springboot/ServiceDeskProcessTest.java @@ -184,7 +184,7 @@ class ServiceDeskProcessTest { .get("/tasks") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("Questionnaire")) .extract() .path("[0].id"); diff --git a/kogito-springboot-examples/process-infinispan-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java b/kogito-springboot-examples/process-infinispan-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java index 8ec0757d3..d6e146ea0 100644 --- a/kogito-springboot-examples/process-infinispan-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java +++ b/kogito-springboot-examples/process-infinispan-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java @@ -65,7 +65,7 @@ public class DealsRestIT { given().accept(ContentType.JSON) .when().get("/deals") .then().statusCode(200) - .body("$.size()", is(1)) + .body("size()", is(1)) .body("[0].id", is(dealId)) .body("[0].name", is(deal)); @@ -78,7 +78,7 @@ public class DealsRestIT { String dealReviewId = given().accept(ContentType.JSON) .when().get("/dealreviews") .then().statusCode(200) - .body("$.size()", is(1)) + .body("size()", is(1)) .body("[0].id", notNullValue()) .body("[0].deal", is(deal)) .extract().path("[0].id"); @@ -87,7 +87,7 @@ public class DealsRestIT { String taskId = given().accept(ContentType.JSON) .when().get("/dealreviews/{uuid}/tasks?user=john", dealReviewId) .then().statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("review")) .body("[0].parameters.deal", is(deal)) .extract().path("[0].id"); @@ -103,12 +103,12 @@ public class DealsRestIT { //verify no deals to review given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().statusCode(200).body("$.size()", is(0)); + .then().statusCode(200).body("size()", is(0)); //verify no deals given().accept(ContentType.JSON) .when().get("/deals") - .then().statusCode(200).body("$.size()", is(0)); + .then().statusCode(200).body("size()", is(0)); } @Test diff --git a/kogito-springboot-examples/process-mongodb-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java b/kogito-springboot-examples/process-mongodb-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java index d3c54a64f..d5d3ab15f 100644 --- a/kogito-springboot-examples/process-mongodb-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java +++ b/kogito-springboot-examples/process-mongodb-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java @@ -58,7 +58,7 @@ public class DealsRestIT { // test getting the created deal given().accept(ContentType.JSON) .when().get("/deals") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1), "[0].id", is(dealId)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1), "[0].id", is(dealId)); // test getting order by id given().accept(ContentType.JSON) @@ -68,12 +68,12 @@ public class DealsRestIT { // get deals for review String dealReviewId = given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); // get task for john String taskId = given().accept(ContentType.JSON) .when().get("/dealreviews/{uuid}/tasks?user=john", dealReviewId) - .then().log().ifValidationFails().statusCode(200).body("$.size", is(1)).extract().path("[0].id"); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1)).extract().path("[0].id"); // complete review task given().contentType(ContentType.JSON).accept(ContentType.JSON).body("{\"review\" : \"very good work\"}") @@ -83,11 +83,11 @@ public class DealsRestIT { //verify no deals to review given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(0)); //verify no deals given().accept(ContentType.JSON) .when().get("/deals") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(0)); } } diff --git a/kogito-springboot-examples/process-monitoring-springboot/src/test/java/org/kie/kogito/examples/springboot/ProcessMetricsTest.java b/kogito-springboot-examples/process-monitoring-springboot/src/test/java/org/kie/kogito/examples/springboot/ProcessMetricsTest.java index 80c7bd225..51c9deaca 100644 --- a/kogito-springboot-examples/process-monitoring-springboot/src/test/java/org/kie/kogito/examples/springboot/ProcessMetricsTest.java +++ b/kogito-springboot-examples/process-monitoring-springboot/src/test/java/org/kie/kogito/examples/springboot/ProcessMetricsTest.java @@ -87,7 +87,7 @@ public class ProcessMetricsTest { // test getting the created order given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); given() .when() diff --git a/kogito-springboot-examples/process-postgresql-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java b/kogito-springboot-examples/process-postgresql-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java index 5ce960474..7e8ab24dc 100644 --- a/kogito-springboot-examples/process-postgresql-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java +++ b/kogito-springboot-examples/process-postgresql-persistence-springboot/src/test/java/org/acme/deals/DealsRestIT.java @@ -58,7 +58,7 @@ public class DealsRestIT { // test getting the created deal given().accept(ContentType.JSON) .when().get("/deals") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1), "[0].id", is(dealId)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1), "[0].id", is(dealId)); // test getting order by id given().accept(ContentType.JSON) @@ -68,12 +68,12 @@ public class DealsRestIT { // get deals for review String dealReviewId = given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1)).body("[0].id", notNullValue()).extract().path("[0].id"); // get task for john String taskId = given().accept(ContentType.JSON) .when().get("/dealreviews/{uuid}/tasks?user=john", dealReviewId) - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(1)).extract().path("[0].id"); + .then().log().ifValidationFails().statusCode(200).body("size()", is(1)).extract().path("[0].id"); // complete review task given().contentType(ContentType.JSON).accept(ContentType.JSON).body("{\"review\" : \"very good work\"}") @@ -83,11 +83,11 @@ public class DealsRestIT { //verify no deals to review given().accept(ContentType.JSON) .when().get("/dealreviews") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(0)); //verify no deals given().accept(ContentType.JSON) .when().get("/deals") - .then().log().ifValidationFails().statusCode(200).body("$.size()", is(0)); + .then().log().ifValidationFails().statusCode(200).body("size()", is(0)); } } diff --git a/kogito-springboot-examples/process-springboot-example/src/test/java/org/kie/kogito/examples/demo/OrdersRestIT.java b/kogito-springboot-examples/process-springboot-example/src/test/java/org/kie/kogito/examples/demo/OrdersRestIT.java index 8f2ace4c9..2558a3c74 100644 --- a/kogito-springboot-examples/process-springboot-example/src/test/java/org/kie/kogito/examples/demo/OrdersRestIT.java +++ b/kogito-springboot-examples/process-springboot-example/src/test/java/org/kie/kogito/examples/demo/OrdersRestIT.java @@ -89,7 +89,7 @@ public class OrdersRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting order by id given() @@ -127,7 +127,7 @@ public class OrdersRestIT { .get("/orders") .then() .statusCode(200) - .body("$.size()", is(1), "[0].id", is(secondCreatedId)); + .body("size()", is(1), "[0].id", is(secondCreatedId)); // delete second before finishing given() @@ -143,7 +143,7 @@ public class OrdersRestIT { .get("/orders") .then() .statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -165,7 +165,7 @@ public class OrdersRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test retrieving error info using process management addon given().accept(ContentType.JSON).when().get("/management/processes/demo.orders/instances/" + firstCreatedId + "/error").then() @@ -186,7 +186,7 @@ public class OrdersRestIT { given().accept(ContentType.JSON).when().delete("/orders/" + firstCreatedId).then().statusCode(200); // get all orders make sure there is zero given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -200,7 +200,7 @@ public class OrdersRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting order by id given().accept(ContentType.JSON).when().get("/orders/" + firstCreatedId).then() @@ -208,7 +208,7 @@ public class OrdersRestIT { // test getting order items subprocess String orderItemsId = given().accept(ContentType.JSON).when().get("/orderItems").then().statusCode(200) - .body("$.size()", is(1)).extract().path("[0].id"); + .body("size()", is(1)).extract().path("[0].id"); // test getting order items by id given().accept(ContentType.JSON).when().get("/orderItems/" + orderItemsId).then() @@ -221,7 +221,7 @@ public class OrdersRestIT { .get("/orderItems/" + orderItemsId + "/tasks?user=john") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("Verify order")) .extract() .path("[0].id"); @@ -239,11 +239,11 @@ public class OrdersRestIT { // get all orders make sure there is zero given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); // get all order items make sure there is zero given().accept(ContentType.JSON).when().get("/orderItems").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -257,7 +257,7 @@ public class OrdersRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting order by id given().accept(ContentType.JSON).when().get("/orders/" + firstCreatedId).then() @@ -265,7 +265,7 @@ public class OrdersRestIT { // test getting order items subprocess String orderItemsId = given().accept(ContentType.JSON).when().get("/orderItems").then().statusCode(200) - .body("$.size()", is(1)).extract().path("[0].id"); + .body("size()", is(1)).extract().path("[0].id"); // test getting order items by id given().accept(ContentType.JSON).when().get("/orderItems/" + orderItemsId).then() @@ -278,7 +278,7 @@ public class OrdersRestIT { .get("/orderItems/" + orderItemsId + "/tasks?user=john") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("Verify order")); // test deleting order items @@ -286,11 +286,11 @@ public class OrdersRestIT { // get all orders make sure there is zero given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); // get all order items make sure there is zero given().accept(ContentType.JSON).when().get("/orderItems").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -304,7 +304,7 @@ public class OrdersRestIT { assertNotNull(id); // get all orders make sure there is one given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1)); + .body("size()", is(1)); // get order by its custom ID and test given().accept(ContentType.JSON).body(orderPayload).when().get("/orders/{id}", id).then() @@ -321,13 +321,13 @@ public class OrdersRestIT { // get all orders make sure there is one given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(1)); + .body("size()", is(1)); // test deleting order items by custom ID given().accept(ContentType.JSON).when().delete("/orders/{id}", id).then().statusCode(200); // get all orders make sure there is zero given().accept(ContentType.JSON).when().get("/orders").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } } diff --git a/kogito-springboot-examples/process-springboot-example/src/test/java/org/kie/kogito/examples/demo/PersonsRestIT.java b/kogito-springboot-examples/process-springboot-example/src/test/java/org/kie/kogito/examples/demo/PersonsRestIT.java index f7c11b9bd..8935e8648 100644 --- a/kogito-springboot-examples/process-springboot-example/src/test/java/org/kie/kogito/examples/demo/PersonsRestIT.java +++ b/kogito-springboot-examples/process-springboot-example/src/test/java/org/kie/kogito/examples/demo/PersonsRestIT.java @@ -76,7 +76,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -90,7 +90,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting task String taskInfo = given() @@ -99,7 +99,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -117,7 +117,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -131,7 +131,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting task String taskInfo = given() @@ -140,7 +140,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -157,7 +157,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -171,7 +171,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting task with wrong user given() @@ -180,7 +180,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=john") .then() .statusCode(200) - .body("$.size", is(0)); + .body("size()", is(0)); String taskInfo = given() .accept(ContentType.JSON) @@ -188,7 +188,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -216,7 +216,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -230,7 +230,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId)); + .body("size()", is(1), "[0].id", is(firstCreatedId)); // test getting task String taskId = given() @@ -239,7 +239,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -260,7 +260,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } // Disabled until KOGITO-1787 is fixed @@ -280,7 +280,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); + .body("size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); // test getting task String taskInfo = given() @@ -289,7 +289,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); @@ -307,7 +307,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -324,7 +324,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); + .body("size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); // test getting task given() @@ -333,7 +333,7 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")); // abort process instance via management interface @@ -342,7 +342,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -359,7 +359,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); + .body("size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); // test getting task String taskInfo = given() @@ -368,13 +368,13 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); String nodeInstanceId = given().contentType(ContentType.JSON).accept(ContentType.JSON).when().get("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances").then() - .statusCode(200).body("$.size()", is(1)).extract().path("[0].nodeInstanceId"); + .statusCode(200).body("size()", is(1)).extract().path("[0].nodeInstanceId"); // retrigger node instance via management interface given().contentType(ContentType.JSON).accept(ContentType.JSON).when().post("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances/" + nodeInstanceId).then() @@ -382,14 +382,14 @@ public class PersonsRestIT { taskInfo = given().accept(ContentType.JSON).when().get("/persons/" + firstCreatedId + "/tasks?user=admin").then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); String retriggeredNodeInstanceId = given().contentType(ContentType.JSON).accept(ContentType.JSON).when().get("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances").then() - .statusCode(200).body("$.size()", is(1)).extract().path("[0].nodeInstanceId"); + .statusCode(200).body("size()", is(1)).extract().path("[0].nodeInstanceId"); // since node instance was retriggered it must have different ids assertNotEquals(nodeInstanceId, retriggeredNodeInstanceId); @@ -406,7 +406,7 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } @Test @@ -423,7 +423,7 @@ public class PersonsRestIT { // test getting the created order given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); + .body("size()", is(1), "[0].id", is(firstCreatedId), "[0].person.adult", is(false)); // test getting task String taskId = given() @@ -432,13 +432,13 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); String nodeInstanceId = given().contentType(ContentType.JSON).accept(ContentType.JSON).when().get("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances").then() - .statusCode(200).body("$.size()", is(1)).extract().path("[0].nodeInstanceId"); + .statusCode(200).body("size()", is(1)).extract().path("[0].nodeInstanceId"); // cancel node instance given().contentType(ContentType.JSON).accept(ContentType.JSON).when().delete("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances/" + nodeInstanceId).then() @@ -454,14 +454,14 @@ public class PersonsRestIT { .get("/persons/" + firstCreatedId + "/tasks?user=admin") .then() .statusCode(200) - .body("$.size", is(1)) + .body("size()", is(1)) .body("[0].name", is("ChildrenHandling")) .extract() .path("[0].id"); String retriggeredNodeInstanceId = given().contentType(ContentType.JSON).accept(ContentType.JSON).when().get("/management/processes/persons/instances/" + firstCreatedId + "/nodeInstances").then() - .statusCode(200).body("$.size()", is(1)).extract().path("[0].nodeInstanceId"); + .statusCode(200).body("size()", is(1)).extract().path("[0].nodeInstanceId"); // since node instance was retriggered it must have different ids assertNotEquals(nodeInstanceId, retriggeredNodeInstanceId); @@ -478,6 +478,6 @@ public class PersonsRestIT { // get all persons make sure there is zero given().accept(ContentType.JSON).when().get("/persons").then().statusCode(200) - .body("$.size()", is(0)); + .body("size()", is(0)); } } diff --git a/kogito-springboot-examples/process-usertasks-with-security-springboot/src/test/java/org/acme/travels/security/springboot/ApprovalsRestTest.java b/kogito-springboot-examples/process-usertasks-with-security-springboot/src/test/java/org/acme/travels/security/springboot/ApprovalsRestTest.java index 68071a739..0a6398263 100644 --- a/kogito-springboot-examples/process-usertasks-with-security-springboot/src/test/java/org/acme/travels/security/springboot/ApprovalsRestTest.java +++ b/kogito-springboot-examples/process-usertasks-with-security-springboot/src/test/java/org/acme/travels/security/springboot/ApprovalsRestTest.java @@ -83,7 +83,7 @@ public class ApprovalsRestTest { .get("/approvals") .then() .statusCode(200) - .body("$.size()", is(1), "[0].id", is(id)); + .body("size()", is(1), "[0].id", is(id)); // get just started approval given() diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/OnboardingIT.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/OnboardingIT.java index ca13febec..0f37350d0 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/OnboardingIT.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/OnboardingIT.java @@ -45,7 +45,7 @@ class OnboardingIT { .get("/onboarding/schedule/appointment") .then() .statusCode(200) - .extract().path("$.size()"); + .extract().path("size()"); given() .body("{ \"name\": \"Yoda\", \"dateOfBirth\": \"1963-08-15\", \"symptoms\":[\"seizures\"]}") --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
