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 3bcad063f1..28f368ab59 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 @@ -18,7 +18,6 @@ */ package org.kie.kogito.flexible.example.quarkus; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -28,6 +27,7 @@ import org.kie.kogito.flexible.example.model.State; import org.kie.kogito.flexible.example.model.SupportCase; import org.kie.kogito.flexible.example.service.TriageService; +import org.kie.kogito.usertask.model.TransitionInfo; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @@ -122,10 +122,9 @@ private void addSupportComment(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "claim") .queryParam("user", "kelly") .queryParam("group", "support") - .body(Collections.emptyMap()) + .body(new TransitionInfo("claim")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -148,10 +147,9 @@ private void addSupportComment(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "complete") .queryParam("user", "kelly") .queryParam("group", "support") - .body(Collections.emptyMap()) + .body(new TransitionInfo("complete")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -200,10 +198,9 @@ private void addCustomerComment(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "claim") .queryParam("user", "Paco") .queryParam("group", "customer") - .body(Collections.emptyMap()) + .body(new TransitionInfo("claim")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -226,10 +223,9 @@ private void addCustomerComment(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "complete") .queryParam("user", "Paco") .queryParam("group", "customer") - .body(Collections.emptyMap()) + .body(new TransitionInfo("complete")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -291,10 +287,9 @@ private void sendQuestionnaire(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "claim") .queryParam("user", "Paco") .queryParam("group", "customer") - .body(Collections.emptyMap()) + .body(new TransitionInfo("claim")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -318,10 +313,9 @@ private void sendQuestionnaire(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "complete") .queryParam("user", "Paco") .queryParam("group", "customer") - .body(Collections.emptyMap()) + .body(new TransitionInfo("complete")) .when() .post("/{userTaskId}/transition", userTaskId) .then() 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 3981f47497..a362c7c4f1 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 @@ -18,8 +18,6 @@ */ package org.kie.kogito.examples; -import java.util.Collections; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; @@ -27,6 +25,7 @@ import org.kie.kogito.process.Process; import org.kie.kogito.testcontainers.quarkus.InfinispanQuarkusTestResource; import org.kie.kogito.testcontainers.quarkus.KafkaQuarkusTestResource; +import org.kie.kogito.usertask.model.TransitionInfo; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @@ -259,10 +258,9 @@ public void testChildPersonsRestWithSecurityPolicyAndLifeCycles() { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "release") .queryParam("user", "admin") .queryParam("group", "admins") - .body(Collections.emptyMap()) + .body(new TransitionInfo("release")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -271,10 +269,9 @@ public void testChildPersonsRestWithSecurityPolicyAndLifeCycles() { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "skip") .queryParam("user", "admin") .queryParam("group", "admins") - .body(Collections.emptyMap()) + .body(new TransitionInfo("skip")) .when() .post("/{userTaskId}/transition", userTaskId) .then() 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 edaf5057ff..78fc2634d9 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 @@ -22,13 +22,13 @@ import org.keycloak.representations.AccessTokenResponse; import org.kie.kogito.test.quarkus.QuarkusTestProperty; import org.kie.kogito.testcontainers.quarkus.KeycloakQuarkusTestResource; +import org.kie.kogito.usertask.model.TransitionInfo; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.http.ContentType; import static io.restassured.RestAssured.given; -import static java.util.Collections.emptyMap; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; @@ -105,10 +105,9 @@ public void testStartApprovalAuthorized() { .contentType(ContentType.JSON) .auth().oauth2(getAccessToken("mary")) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "complete") .queryParam("user", "manager") .queryParam("group", "managers") - .body(emptyMap()) + .body(new TransitionInfo("complete")) .when() .post("/{userTaskId}/transition", userTaskId) .then() 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 26b16e4828..02bf28d201 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 @@ -18,7 +18,6 @@ */ package org.kie.kogito.flexible.example.springboot; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,6 +29,7 @@ import org.kie.kogito.flexible.example.model.SupportCase; import org.kie.kogito.flexible.example.service.TriageService; import org.kie.kogito.tests.KogitoSpringbootApplication; +import org.kie.kogito.usertask.model.TransitionInfo; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.test.annotation.DirtiesContext; @@ -136,10 +136,9 @@ private void addSupportComment(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "claim") .queryParam("user", "kelly") .queryParam("group", "support") - .body(Collections.emptyMap()) + .body(new TransitionInfo("claim")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -162,10 +161,9 @@ private void addSupportComment(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "complete") .queryParam("user", "kelly") .queryParam("group", "support") - .body(Collections.emptyMap()) + .body(new TransitionInfo("complete")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -214,10 +212,9 @@ private void addCustomerComment(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "claim") .queryParam("user", "Paco") .queryParam("group", "customer") - .body(Collections.emptyMap()) + .body(new TransitionInfo("claim")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -240,10 +237,9 @@ private void addCustomerComment(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "complete") .queryParam("user", "Paco") .queryParam("group", "customer") - .body(Collections.emptyMap()) + .body(new TransitionInfo("complete")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -305,10 +301,9 @@ private void sendQuestionnaire(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "claim") .queryParam("user", "Paco") .queryParam("group", "customer") - .body(Collections.emptyMap()) + .body(new TransitionInfo("claim")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -332,10 +327,9 @@ private void sendQuestionnaire(String id) { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "complete") .queryParam("user", "Paco") .queryParam("group", "customer") - .body(Collections.emptyMap()) + .body(new TransitionInfo("complete")) .when() .post("/{userTaskId}/transition", userTaskId) .then() 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 2b0c5844ce..273b0de99f 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 @@ -18,8 +18,6 @@ */ package org.kie.kogito.examples.demo; -import java.util.Collections; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; @@ -29,6 +27,7 @@ import org.kie.kogito.process.Process; import org.kie.kogito.testcontainers.springboot.InfinispanSpringBootTestResource; import org.kie.kogito.testcontainers.springboot.KafkaSpringBootTestResource; +import org.kie.kogito.usertask.model.TransitionInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; @@ -47,7 +46,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.kie.kogito.test.utils.ProcessInstancesTestUtils.abort; -@SuppressWarnings("rawtypes") @ExtendWith(SpringExtension.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = DemoApplication.class) @ContextConfiguration(initializers = { InfinispanSpringBootTestResource.Conditional.class, KafkaSpringBootTestResource.Conditional.class }) @@ -266,10 +264,9 @@ public void testChildPersonsRestWithSecurityPolicyAndLifeCycles() { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "release") .queryParam("user", "admin") .queryParam("group", "admins") - .body(Collections.emptyMap()) + .body(new TransitionInfo("release")) .when() .post("/{userTaskId}/transition", userTaskId) .then() @@ -278,10 +275,9 @@ public void testChildPersonsRestWithSecurityPolicyAndLifeCycles() { given() .contentType(ContentType.JSON) .basePath(USER_TASK_BASE_PATH) - .queryParam("transitionId", "skip") .queryParam("user", "admin") .queryParam("group", "admins") - .body(Collections.emptyMap()) + .body(new TransitionInfo("skip")) .when() .post("/{userTaskId}/transition", userTaskId) .then()