This is an automated email from the ASF dual-hosted git repository.

egonzalez pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new b4808656e [incubator-kie-issues-1522] Transition object to make 
extensible usertask transition restendpoint (#2021)
b4808656e is described below

commit b4808656ef9cd17c6bc4bc311c47e482352662db
Author: Enrique <[email protected]>
AuthorDate: Mon Oct 21 09:21:48 2024 +0200

    [incubator-kie-issues-1522] Transition object to make extensible usertask 
transition restendpoint (#2021)
---
 .../example/quarkus/ServiceDeskProcessTest.java      | 20 +++++++-------------
 .../java/org/kie/kogito/examples/PersonsRestIT.java  |  9 +++------
 .../test/java/org/acme/travels/ApprovalsRestIT.java  |  5 ++---
 .../example/springboot/ServiceDeskProcessTest.java   | 20 +++++++-------------
 .../org/kie/kogito/examples/demo/PersonsRestIT.java  | 10 +++-------
 5 files changed, 22 insertions(+), 42 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 3bcad063f..28f368ab5 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.Product;
 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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 3981f4749..a362c7c4f 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.Model;
 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 class PersonsRestIT {
         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 class PersonsRestIT {
         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 edaf5057f..78fc2634d 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.junit.jupiter.api.Test;
 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 class ApprovalsRestIT {
                 .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 26b16e482..02bf28d20 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.State;
 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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 @@ class ServiceDeskProcessTest {
         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 2b0c5844c..273b0de99 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.examples.DemoApplication;
 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.assertNotEquals;
 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 class PersonsRestIT {
         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 class PersonsRestIT {
         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()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to