martinweiler commented on code in PR #4164:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4164#discussion_r2737913040


##########
quarkus/integration-tests/integration-tests-quarkus-wshumantasks/src/test/java/org/jbpm/usertask/jpa/it/WsHumanTaskLifeCycleIT.java:
##########
@@ -494,26 +783,26 @@ public String startProcessInstance(String processId) {
         return pid;
     }
 
-    private void isProcessCompleted(String processId) {
+    private void isProcessCompleted(String processId, String pid) {
         given()
                 .accept(ContentType.JSON)
                 .when()
-                .get("/{processId}", processId)
+                .get("/{processId}/{pid}", processId, pid)
                 .then()
-                .statusCode(200)
-                .body("$.size()", is(0));
+                .statusCode(404);
     }
 
-    private String getTaskId(String user) {
+    private String getTaskId(String user, String pid) {
         return given().contentType(ContentType.JSON)
                 .when()
                 .queryParam("user", user)
                 .get(USER_TASKS_ENDPOINT)
                 .then()
                 .statusCode(200)
-                .body("$.size()", is(1))
                 .extract()
-                .path("[0].id");
+                .jsonPath()
+                .param("pid", pid)
+                .getString("find { it.processInfo.processInstanceId == pid 
}.id");

Review Comment:
   Side note: While this is a nice solution, we need to expand the usertask 
endpoint to return tasks for a specific process instance OOTB. Could you please 
create a JIRA?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to