Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync main branch with Apache main branch #43

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
*/
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;
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;
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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 })
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
Loading