From de41f4fbb7db41ca3f0a8b5fc0c27dcec238db55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pere=20Fern=C3=A1ndez?= Date: Mon, 18 Nov 2024 19:12:09 +0100 Subject: [PATCH 1/5] [incubator-kie-issues#1624] Add missing auth header to data-index SVG request (#2143) --- .../kogito/index/addon/api/KogitoAddonRuntimeClientImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/main/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImpl.java b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/main/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImpl.java index 697dcfd1e0..1f9b64d91d 100644 --- a/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/main/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImpl.java +++ b/data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-common/runtime/src/main/java/org/kie/kogito/index/addon/api/KogitoAddonRuntimeClientImpl.java @@ -130,7 +130,8 @@ public CompletableFuture getProcessInstanceDiagram(String serviceURL, Pr if (processSvgService == null) { return CompletableFuture.completedFuture(null); } else { - return CompletableFuture.supplyAsync(() -> processSvgService.getProcessInstanceSvg(processInstance.getProcessId(), processInstance.getId(), null).orElse(null), managedExecutor); + return CompletableFuture.supplyAsync(() -> processSvgService.getProcessInstanceSvg(processInstance.getProcessId(), processInstance.getId(), this.getAuthHeader()).orElse(null), + managedExecutor); } } From ae401d0e0d092608ccf30549f70d0f5ab06050b2 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:59:57 +0100 Subject: [PATCH 2/5] [Fix apache/incubator-kie-kogito-runtimes#3782] (#2144) Using copy-resource, which works with directories plugin --- .../pom.xml | 45 +++++++++++++----- .../pom.xml | 45 +++++++++++++----- .../pom.xml | 46 +++++++++++++----- .../pom.xml | 47 +++++++++++++------ 4 files changed, 132 insertions(+), 51 deletions(-) diff --git a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-embedded/pom.xml b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-embedded/pom.xml index 72383b29ad..d244649644 100644 --- a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-embedded/pom.xml +++ b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-embedded/pom.xml @@ -100,18 +100,39 @@ + + maven-resources-plugin + + + generate-resources + + copy-resources + + + ${project.basedir}/src/main/resources/shared + + + ${common.test.resources.dir} + + **/*.bpmn + **/*.sw.json + + + + + + + + + maven-clean-plugin + + + + ${project.basedir}/src/main/resources/shared + + + + - - - src/main/resources - - - ${common.test.resources.dir} - - **/*.bpmn - **/*.sw.json - - - diff --git a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-knative-eventing/pom.xml b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-knative-eventing/pom.xml index 309ff02dcb..e105b0f06a 100644 --- a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-knative-eventing/pom.xml +++ b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-knative-eventing/pom.xml @@ -88,18 +88,39 @@ + + maven-resources-plugin + + + generate-resources + + copy-resources + + + ${project.basedir}/src/main/resources/shared + + + ${common.test.resources.dir} + + **/*.bpmn + **/*.sw.json + + + + + + + + + maven-clean-plugin + + + + ${project.basedir}/src/main/resources/shared + + + + - - - src/main/resources - - - ${common.test.resources.dir} - - **/*.bpmn - **/*.sw.json - - - diff --git a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-management/pom.xml b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-management/pom.xml index ade7cbe17e..6cccd4aa7a 100644 --- a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-management/pom.xml +++ b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-management/pom.xml @@ -79,7 +79,6 @@ io.quarkus quarkus-maven-plugin - ${version.io.quarkus} true @@ -91,18 +90,39 @@ + + maven-resources-plugin + + + generate-resources + + copy-resources + + + ${project.basedir}/src/main/resources/shared + + + ${common.test.resources.dir} + + **/*.bpmn + **/*.sw.json + + + + + + + + + maven-clean-plugin + + + + ${project.basedir}/src/main/resources/shared + + + + - - - src/main/resources - - - ${common.test.resources.dir} - - **/*.bpmn - **/*.sw.json - - - diff --git a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-messaging/pom.xml b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-messaging/pom.xml index 3ccd6395dd..fba2a2c5f1 100644 --- a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-messaging/pom.xml +++ b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-quarkus/integration-tests-jobs-service-quarkus-messaging/pom.xml @@ -94,24 +94,10 @@ - - - src/main/resources - - - ${common.test.resources.dir} - - **/*.bpmn - **/*.sw.json - - - - io.quarkus quarkus-maven-plugin - ${version.io.quarkus} true @@ -123,6 +109,39 @@ + + maven-resources-plugin + + + generate-resources + + copy-resources + + + ${project.basedir}/src/main/resources/shared + + + ${common.test.resources.dir} + + **/*.bpmn + **/*.sw.json + + + + + + + + + maven-clean-plugin + + + + ${project.basedir}/src/main/resources/shared + + + + From fe90635fa677e0d8aa3bd5013ef99e617375645f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pere=20Fern=C3=A1ndez?= Date: Wed, 20 Nov 2024 20:53:40 +0100 Subject: [PATCH 3/5] [incubator-kie-issues#1629] Add SLA information to ProcessInstances & NodeInstances (#2145) * [incubator-kie-issues#1629] Add SLA information to ProcessInstances & NodeInstances * - add slaDueDate to ProcessInstanceEntity toString --- .../src/main/resources/basic.schema.graphqls | 2 ++ .../kie/kogito/index/model/NodeInstance.java | 11 ++++++++++ .../index/model/ProcessInstanceMeta.java | 9 ++++++++ .../ProcessInstanceNodeDataEventMerger.java | 1 + .../ProcessInstanceStateDataEventMerger.java | 1 + .../protostream/NodeInstanceMarshaller.java | 2 ++ .../ProcessInstanceMarshaller.java | 3 +++ .../index/jpa/model/NodeInstanceEntity.java | 9 ++++++++ .../jpa/model/ProcessInstanceEntity.java | 12 +++++++++++ .../storage/ProcessInstanceEntityStorage.java | 2 ++ .../AbstractProcessInstanceStorageIT.java | 4 ++-- .../V1.45.0.6__add_sla_due_date_columns.sql | 21 +++++++++++++++++++ .../mongodb/model/ProcessInstanceEntity.java | 20 ++++++++++++++++++ .../model/ProcessInstanceEntityMapper.java | 4 ++++ .../V1.45.0.6__add_sla_due_date_columns.sql | 21 +++++++++++++++++++ .../resources/META-INF/kogito-index.proto | 2 ++ 16 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 data-index/data-index-storage/data-index-storage-jpa/src/main/resources/kie-flyway/db/data-index/ansi/V1.45.0.6__add_sla_due_date_columns.sql create mode 100644 data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/kie-flyway/db/data-index/postgresql/V1.45.0.6__add_sla_due_date_columns.sql diff --git a/data-index/data-index-graphql/src/main/resources/basic.schema.graphqls b/data-index/data-index-graphql/src/main/resources/basic.schema.graphqls index 741c0d4e89..0317ec61c5 100644 --- a/data-index/data-index-graphql/src/main/resources/basic.schema.graphqls +++ b/data-index/data-index-graphql/src/main/resources/basic.schema.graphqls @@ -96,6 +96,7 @@ type ProcessInstance { identity: String createdBy: String updatedBy: String + slaDueDate: DateTime } type ProcessInstanceError { @@ -135,6 +136,7 @@ type NodeInstance { exit: DateTime definitionId: String! nodeId: String! + slaDueDate: DateTime } enum MilestoneStatus { diff --git a/data-index/data-index-storage/data-index-storage-api/src/main/java/org/kie/kogito/index/model/NodeInstance.java b/data-index/data-index-storage/data-index-storage-api/src/main/java/org/kie/kogito/index/model/NodeInstance.java index 1e22527c59..ab9df6cadd 100644 --- a/data-index/data-index-storage/data-index-storage-api/src/main/java/org/kie/kogito/index/model/NodeInstance.java +++ b/data-index/data-index-storage/data-index-storage-api/src/main/java/org/kie/kogito/index/model/NodeInstance.java @@ -38,6 +38,8 @@ public class NodeInstance { @JsonProperty("leaveTime") private ZonedDateTime exit; + private ZonedDateTime slaDueDate; + @JsonProperty("nodeDefinitionId") private String definitionId; @@ -97,6 +99,14 @@ public void setName(String name) { this.name = name; } + public ZonedDateTime getSlaDueDate() { + return slaDueDate; + } + + public void setSlaDueDate(ZonedDateTime slaDueDate) { + this.slaDueDate = slaDueDate; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -125,6 +135,7 @@ public String toString() { ", type='" + type + '\'' + ", enter=" + enter + ", exit=" + exit + + ", slaDueDate=" + slaDueDate + ", definitionId='" + definitionId + '\'' + '}'; } diff --git a/data-index/data-index-storage/data-index-storage-api/src/main/java/org/kie/kogito/index/model/ProcessInstanceMeta.java b/data-index/data-index-storage/data-index-storage-api/src/main/java/org/kie/kogito/index/model/ProcessInstanceMeta.java index d211ea198d..09441ca019 100644 --- a/data-index/data-index-storage/data-index-storage-api/src/main/java/org/kie/kogito/index/model/ProcessInstanceMeta.java +++ b/data-index/data-index-storage/data-index-storage-api/src/main/java/org/kie/kogito/index/model/ProcessInstanceMeta.java @@ -49,6 +49,7 @@ public class ProcessInstanceMeta { @JsonProperty("updatedBy") private String updatedBy; private ZonedDateTime lastUpdate; + private ZonedDateTime slaDueDate; public String getId() { return id; @@ -186,6 +187,14 @@ public void setUpdatedBy(String updatedBy) { this.updatedBy = updatedBy; } + public ZonedDateTime getSlaDueDate() { + return slaDueDate; + } + + public void setSlaDueDate(ZonedDateTime slaDueDate) { + this.slaDueDate = slaDueDate; + } + @Override public String toString() { return "ProcessInstanceMeta{" + diff --git a/data-index/data-index-storage/data-index-storage-common/src/main/java/org/kie/kogito/index/storage/merger/ProcessInstanceNodeDataEventMerger.java b/data-index/data-index-storage/data-index-storage-common/src/main/java/org/kie/kogito/index/storage/merger/ProcessInstanceNodeDataEventMerger.java index d800dfd226..bb7c39a5bc 100644 --- a/data-index/data-index-storage/data-index-storage-common/src/main/java/org/kie/kogito/index/storage/merger/ProcessInstanceNodeDataEventMerger.java +++ b/data-index/data-index-storage/data-index-storage-common/src/main/java/org/kie/kogito/index/storage/merger/ProcessInstanceNodeDataEventMerger.java @@ -63,6 +63,7 @@ public ProcessInstance merge(ProcessInstance pi, ProcessInstanceDataEvent dat nodeInstance.setNodeId(body.getNodeDefinitionId()); nodeInstance.setName(body.getNodeName()); nodeInstance.setType(body.getNodeType()); + nodeInstance.setSlaDueDate(toZonedDateTime(body.getSlaDueDate())); ZonedDateTime eventDate = toZonedDateTime(body.getEventDate()); switch (body.getEventType()) { case EVENT_TYPE_ENTER: diff --git a/data-index/data-index-storage/data-index-storage-common/src/main/java/org/kie/kogito/index/storage/merger/ProcessInstanceStateDataEventMerger.java b/data-index/data-index-storage/data-index-storage-common/src/main/java/org/kie/kogito/index/storage/merger/ProcessInstanceStateDataEventMerger.java index b49036fb0c..a7be6d0ea3 100644 --- a/data-index/data-index-storage/data-index-storage-common/src/main/java/org/kie/kogito/index/storage/merger/ProcessInstanceStateDataEventMerger.java +++ b/data-index/data-index-storage/data-index-storage-common/src/main/java/org/kie/kogito/index/storage/merger/ProcessInstanceStateDataEventMerger.java @@ -63,6 +63,7 @@ public ProcessInstance merge(ProcessInstance pi, ProcessInstanceDataEvent dat pi.setLastUpdate(toZonedDateTime(event.getTime())); pi.setDefinition(definitions(event)); pi.setUpdatedBy(event.getData().getEventUser()); + pi.setSlaDueDate(toZonedDateTime(event.getData().getSlaDueDate())); LOGGER.debug("Value after merging: {}", pi); return pi; } diff --git a/data-index/data-index-storage/data-index-storage-infinispan/src/main/java/org/kie/kogito/index/infinispan/protostream/NodeInstanceMarshaller.java b/data-index/data-index-storage/data-index-storage-infinispan/src/main/java/org/kie/kogito/index/infinispan/protostream/NodeInstanceMarshaller.java index 194ad08caa..dd4b5f557c 100644 --- a/data-index/data-index-storage/data-index-storage-infinispan/src/main/java/org/kie/kogito/index/infinispan/protostream/NodeInstanceMarshaller.java +++ b/data-index/data-index-storage/data-index-storage-infinispan/src/main/java/org/kie/kogito/index/infinispan/protostream/NodeInstanceMarshaller.java @@ -42,6 +42,7 @@ public NodeInstance readFrom(ProtoStreamReader reader) throws IOException { node.setExit(dateToZonedDateTime(reader.readDate("exit"))); node.setDefinitionId(reader.readString("definitionId")); node.setNodeId(reader.readString("nodeId")); + node.setSlaDueDate(dateToZonedDateTime(reader.readDate("slaDueDate"))); return node; } @@ -54,6 +55,7 @@ public void writeTo(ProtoStreamWriter writer, NodeInstance node) throws IOExcept writer.writeDate("exit", zonedDateTimeToDate(node.getExit())); writer.writeString("definitionId", node.getDefinitionId()); writer.writeString("nodeId", node.getNodeId()); + writer.writeDate("slaDueDate", zonedDateTimeToDate(node.getSlaDueDate())); } @Override diff --git a/data-index/data-index-storage/data-index-storage-infinispan/src/main/java/org/kie/kogito/index/infinispan/protostream/ProcessInstanceMarshaller.java b/data-index/data-index-storage/data-index-storage-infinispan/src/main/java/org/kie/kogito/index/infinispan/protostream/ProcessInstanceMarshaller.java index ab391703aa..3e46ea2bf3 100644 --- a/data-index/data-index-storage/data-index-storage-infinispan/src/main/java/org/kie/kogito/index/infinispan/protostream/ProcessInstanceMarshaller.java +++ b/data-index/data-index-storage/data-index-storage-infinispan/src/main/java/org/kie/kogito/index/infinispan/protostream/ProcessInstanceMarshaller.java @@ -55,6 +55,7 @@ public class ProcessInstanceMarshaller extends AbstractMarshaller implements Mes protected static final String MILESTONES = "milestones"; protected static final String CREATED_BY = "createdBy"; protected static final String UPDATED_BY = "updatedBy"; + protected static final String SLA_DUE_DATE = "slaDueDate"; public ProcessInstanceMarshaller(ObjectMapper mapper) { super(mapper); @@ -84,6 +85,7 @@ public ProcessInstance readFrom(ProtoStreamReader reader) throws IOException { pi.setVersion(reader.readString(VERSION)); pi.setCreatedBy(reader.readString(CREATED_BY)); pi.setUpdatedBy(reader.readString(UPDATED_BY)); + pi.setSlaDueDate(dateToZonedDateTime(reader.readDate(SLA_DUE_DATE))); return pi; } @@ -110,6 +112,7 @@ public void writeTo(ProtoStreamWriter writer, ProcessInstance pi) throws IOExcep writer.writeString(VERSION, pi.getVersion()); writer.writeString(CREATED_BY, pi.getCreatedBy()); writer.writeString(UPDATED_BY, pi.getCreatedBy()); + writer.writeDate(SLA_DUE_DATE, zonedDateTimeToDate(pi.getSlaDueDate())); } @Override diff --git a/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeInstanceEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeInstanceEntity.java index 347e6f9a7f..51c5bef912 100644 --- a/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeInstanceEntity.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeInstanceEntity.java @@ -43,6 +43,7 @@ public class NodeInstanceEntity extends AbstractEntity { private String type; private ZonedDateTime enter; private ZonedDateTime exit; + private ZonedDateTime slaDueDate; private String definitionId; @ManyToOne(cascade = CascadeType.ALL, optional = false) @OnDelete(action = OnDeleteAction.CASCADE) @@ -106,6 +107,14 @@ public void setExit(ZonedDateTime exit) { this.exit = exit; } + public ZonedDateTime getSlaDueDate() { + return slaDueDate; + } + + public void setSlaDueDate(ZonedDateTime slaDueDate) { + this.slaDueDate = slaDueDate; + } + public ProcessInstanceEntity getProcessInstance() { return processInstance; } diff --git a/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntity.java index 7046de267b..a3a0b0ceb3 100644 --- a/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntity.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntity.java @@ -68,6 +68,9 @@ public class ProcessInstanceEntity extends AbstractEntity { private String createdBy; private String updatedBy; + + private ZonedDateTime slaDueDate; + @Convert(converter = JsonBinaryConverter.class) @Column(columnDefinition = "jsonb") private ObjectNode variables; @@ -203,6 +206,14 @@ public void setUpdatedBy(String updatedBy) { this.updatedBy = updatedBy; } + public ZonedDateTime getSlaDueDate() { + return slaDueDate; + } + + public void setSlaDueDate(ZonedDateTime slaDueDate) { + this.slaDueDate = slaDueDate; + } + public ObjectNode getVariables() { return variables; } @@ -286,6 +297,7 @@ public String toString() { ", lastUpdate=" + lastUpdate + ", createdBy=" + createdBy + ", updatedBy=" + updatedBy + + ", slaDueDate=" + slaDueDate + ", variables=" + variables + ", nodes=" + nodes + ", milestones=" + milestones + diff --git a/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java index 8796f3204a..68e5d24844 100644 --- a/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java @@ -179,6 +179,7 @@ private NodeInstanceEntity updateNode(NodeInstanceEntity nodeInstance, ProcessIn nodeInstance.setNodeId(body.getNodeDefinitionId()); nodeInstance.setName(body.getNodeName()); nodeInstance.setType(body.getNodeType()); + nodeInstance.setSlaDueDate(toZonedDateTime(body.getSlaDueDate())); ZonedDateTime eventDate = toZonedDateTime(body.getEventDate()); switch (body.getEventType()) { case EVENT_TYPE_ENTER: @@ -219,6 +220,7 @@ private void indexState(ProcessInstanceEntity pi, ProcessInstanceStateEventBody pi.setLastUpdate(toZonedDateTime(data.getEventDate())); pi.setAddons(addons); pi.setEndpoint(endpoint); + pi.setSlaDueDate(toZonedDateTime(data.getSlaDueDate())); } private void indexVariable(ProcessInstanceEntity pi, ProcessInstanceVariableEventBody data) { diff --git a/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractProcessInstanceStorageIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractProcessInstanceStorageIT.java index b60f7ed300..f8f8c6674e 100644 --- a/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractProcessInstanceStorageIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractProcessInstanceStorageIT.java @@ -109,7 +109,7 @@ public void testProcessInstanceNodeEvent() { .hasSize(1); Assertions.assertThat(processInstance.getNodes().get(0)) - .hasNoNullFieldsOrPropertiesExcept("exit") + .hasNoNullFieldsOrPropertiesExcept("exit", "slaDueDate") .hasFieldOrPropertyWithValue("name", "nodeName") .hasFieldOrPropertyWithValue("type", "BoundaryEventNode") .hasFieldOrPropertyWithValue("definitionId", nodeDefinitionId) @@ -125,7 +125,7 @@ public void testProcessInstanceNodeEvent() { .hasSize(1); Assertions.assertThat(processInstance.getNodes().get(0)) - .hasNoNullFieldsOrProperties() + .hasNoNullFieldsOrPropertiesExcept("slaDueDate") .hasFieldOrPropertyWithValue("name", "nodeName") .hasFieldOrPropertyWithValue("type", "BoundaryEventNode") .hasFieldOrPropertyWithValue("definitionId", nodeDefinitionId) diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/kie-flyway/db/data-index/ansi/V1.45.0.6__add_sla_due_date_columns.sql b/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/kie-flyway/db/data-index/ansi/V1.45.0.6__add_sla_due_date_columns.sql new file mode 100644 index 0000000000..fdd7838f41 --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/kie-flyway/db/data-index/ansi/V1.45.0.6__add_sla_due_date_columns.sql @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +ALTER TABLE processes ADD sla_due_date timestamp; +ALTER TABLE nodes ADD sla_due_date timestamp; \ No newline at end of file diff --git a/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/ProcessInstanceEntity.java b/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/ProcessInstanceEntity.java index 28cef62442..5a66e6f298 100644 --- a/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/ProcessInstanceEntity.java +++ b/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/ProcessInstanceEntity.java @@ -70,6 +70,8 @@ public class ProcessInstanceEntity { String updatedBy; + Long slaDueDate; + public String getId() { return id; } @@ -238,6 +240,14 @@ public void setUpdatedBy(String updatedBy) { this.updatedBy = updatedBy; } + public Long getSlaDueDate() { + return slaDueDate; + } + + public void setSlaDueDate(Long slaDueDate) { + this.slaDueDate = slaDueDate; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -271,6 +281,8 @@ public static class NodeInstanceEntity { String definitionId; + Long slaDueDate; + public String getId() { return id; } @@ -327,6 +339,14 @@ public void setDefinitionId(String definitionId) { this.definitionId = definitionId; } + public Long getSlaDueDate() { + return slaDueDate; + } + + public void setSlaDueDate(Long slaDueDate) { + this.slaDueDate = slaDueDate; + } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/ProcessInstanceEntityMapper.java b/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/ProcessInstanceEntityMapper.java index 16e1f13d3c..18e674d57e 100644 --- a/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/ProcessInstanceEntityMapper.java +++ b/data-index/data-index-storage/data-index-storage-mongodb/src/main/java/org/kie/kogito/index/mongodb/model/ProcessInstanceEntityMapper.java @@ -77,6 +77,7 @@ public ProcessInstanceEntity mapToEntity(String key, ProcessInstance instance) { entity.setVersion(instance.getVersion()); entity.setCreatedBy(instance.getCreatedBy()); entity.setUpdatedBy(instance.getUpdatedBy()); + entity.setSlaDueDate(zonedDateTimeToInstant(instance.getSlaDueDate())); return entity; } @@ -108,6 +109,7 @@ public ProcessInstance mapToModel(ProcessInstanceEntity entity) { instance.setVersion(entity.getVersion()); instance.setCreatedBy(entity.getCreatedBy()); instance.setUpdatedBy(entity.getCreatedBy()); + instance.setSlaDueDate(instantToZonedDateTime(entity.getSlaDueDate())); return instance; } @@ -146,6 +148,7 @@ NodeInstance toNodeInstance(ProcessInstanceEntity.NodeInstanceEntity entity) { instance.setEnter(instantToZonedDateTime(entity.getEnter())); instance.setExit(instantToZonedDateTime(entity.getExit())); instance.setDefinitionId(entity.getDefinitionId()); + instance.setSlaDueDate(instantToZonedDateTime(entity.getSlaDueDate())); return instance; } @@ -162,6 +165,7 @@ ProcessInstanceEntity.NodeInstanceEntity fromNodeInstance(NodeInstance instance) entity.setEnter(zonedDateTimeToInstant(instance.getEnter())); entity.setExit(zonedDateTimeToInstant(instance.getExit())); entity.setDefinitionId(instance.getDefinitionId()); + entity.setSlaDueDate(zonedDateTimeToInstant(instance.getSlaDueDate())); return entity; } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/kie-flyway/db/data-index/postgresql/V1.45.0.6__add_sla_due_date_columns.sql b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/kie-flyway/db/data-index/postgresql/V1.45.0.6__add_sla_due_date_columns.sql new file mode 100644 index 0000000000..58b83a3266 --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/kie-flyway/db/data-index/postgresql/V1.45.0.6__add_sla_due_date_columns.sql @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +ALTER TABLE IF exists processes ADD COLUMN IF NOT EXISTS sla_due_date timestamp; +ALTER TABLE IF exists nodes ADD COLUMN IF NOT EXISTS sla_due_date timestamp; \ No newline at end of file diff --git a/data-index/data-index-storage/data-index-storage-protobuf/src/main/resources/META-INF/kogito-index.proto b/data-index/data-index-storage/data-index-storage-protobuf/src/main/resources/META-INF/kogito-index.proto index 5c23eecefa..ed6d7c09ee 100644 --- a/data-index/data-index-storage/data-index-storage-protobuf/src/main/resources/META-INF/kogito-index.proto +++ b/data-index/data-index-storage/data-index-storage-protobuf/src/main/resources/META-INF/kogito-index.proto @@ -153,6 +153,7 @@ message ProcessInstance { optional string createdBy = 20; /* @Field(store = Store.YES) */ optional string updatedBy = 21; + optional int64 slaDueDate = 22; } /* @Indexed */ @@ -177,6 +178,7 @@ message NodeInstance { optional string definitionId = 6; /* @Field(store = Store.YES) */ optional string nodeId = 7; + optional int64 slaDueDate = 8; } /* @Indexed */ From 5d0373d441bda2b69df6cd5a07efd7ed337a2902 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:59:57 +0100 Subject: [PATCH 4/5] [bot][main]: bump com.google.cloud.tools:jib-maven-plugin (#2137) Bumps [com.google.cloud.tools:jib-maven-plugin](https://github.com/GoogleContainerTools/jib) from 3.3.1 to 3.4.4. - [Release notes](https://github.com/GoogleContainerTools/jib/releases) - [Commits](https://github.com/GoogleContainerTools/jib/commits) --- updated-dependencies: - dependency-name: com.google.cloud.tools:jib-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../integration-tests-trusty-service-springboot/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-springboot/pom.xml b/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-springboot/pom.xml index fd37954413..8ccdf7d69c 100644 --- a/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-springboot/pom.xml +++ b/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-springboot/pom.xml @@ -33,7 +33,7 @@ org.kie.kogito/integration-tests-trusty-service-springboot:${project.version} **/KogitoApplication.java - 3.3.1 + 3.4.4 eclipse-temurin:17-jre From c5b176dc75d4e291924ba697844e056b66296eff Mon Sep 17 00:00:00 2001 From: Walter Medvedeo Date: Fri, 22 Nov 2024 09:17:35 +0100 Subject: [PATCH 5/5] kie-kogito-apps-2146: Remove un-needed dependency to keycloak-common (#2147) --- .../integration-tests-trusty-service-common/pom.xml | 4 ---- .../it/trusty/AbstractTrustyExplainabilityEnd2EndIT.java | 3 +-- .../data-index-service/data-index-service-common/pom.xml | 5 ----- .../AbstractKeycloakIntegrationIndexingServiceIT.java | 3 +-- .../data-index-service/data-index-service-infinispan/pom.xml | 5 ----- .../data-index-service/data-index-service-inmemory/pom.xml | 5 ----- .../data-index-service/data-index-service-mongodb/pom.xml | 5 ----- .../data-index-service/data-index-service-postgresql/pom.xml | 5 ----- explainability/explainability-service-rest/pom.xml | 5 ----- .../explainability/rest/KeycloakExplainabilityServiceIT.java | 3 +-- jobs-service/jobs-service-common/pom.xml | 5 ----- .../jobs/service/resource/BaseKeycloakJobServiceTest.java | 3 +-- jobs-service/jobs-service-infinispan/pom.xml | 5 ----- jobs-service/jobs-service-inmemory/pom.xml | 5 ----- jobs-service/jobs-service-mongodb/pom.xml | 5 ----- jobs-service/jobs-service-postgresql-common/pom.xml | 5 ----- jobs-service/jobs-service-storage-jpa/pom.xml | 5 ----- security-commons/pom.xml | 5 ----- .../kogito/security/KeycloakSecurityCommonsServiceIT.java | 3 +-- trusty/trusty-service/trusty-service-common/pom.xml | 5 ----- .../trusty/service/common/KeycloakTrustyServiceIT.java | 3 +-- 21 files changed, 6 insertions(+), 86 deletions(-) diff --git a/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-common/pom.xml b/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-common/pom.xml index 1ad411f350..9aafdb5dad 100644 --- a/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-common/pom.xml +++ b/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-common/pom.xml @@ -87,10 +87,6 @@ kogito-test-utils compile - - org.keycloak - keycloak-core - diff --git a/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-common/src/main/java/org/kie/kogito/it/trusty/AbstractTrustyExplainabilityEnd2EndIT.java b/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-common/src/main/java/org/kie/kogito/it/trusty/AbstractTrustyExplainabilityEnd2EndIT.java index 4207ff9ae6..0ce911613a 100644 --- a/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-common/src/main/java/org/kie/kogito/it/trusty/AbstractTrustyExplainabilityEnd2EndIT.java +++ b/apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-common/src/main/java/org/kie/kogito/it/trusty/AbstractTrustyExplainabilityEnd2EndIT.java @@ -29,7 +29,6 @@ import java.util.stream.Collectors; import org.junit.jupiter.api.Test; -import org.keycloak.representations.AccessTokenResponse; import org.kie.kogito.explainability.api.CounterfactualSearchDomain; import org.kie.kogito.explainability.api.CounterfactualSearchDomainCollectionValue; import org.kie.kogito.explainability.api.CounterfactualSearchDomainStructureValue; @@ -183,7 +182,7 @@ public void doTest() { .param(KEYCLOAK_CLIENT_SECRET_PARAM_NAME, KEYCLOAK_CLIENT_SECRET_PARAM_VALUE) .when() .post(KEYCLOAK_ACCESS_TOKEN_PATH) - .as(AccessTokenResponse.class).getToken(); + .jsonPath().get("access_token"); assertNotNull(accessToken); diff --git a/data-index/data-index-service/data-index-service-common/pom.xml b/data-index/data-index-service/data-index-service-common/pom.xml index a3eb73abd7..4abb945f17 100644 --- a/data-index/data-index-service/data-index-service-common/pom.xml +++ b/data-index/data-index-service/data-index-service-common/pom.xml @@ -141,11 +141,6 @@ json-unit-assertj test - - org.keycloak - keycloak-core - test - org.kie.kogito kogito-quarkus-test-utils diff --git a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/AbstractKeycloakIntegrationIndexingServiceIT.java b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/AbstractKeycloakIntegrationIndexingServiceIT.java index f2fcd37cd0..c91e5195a5 100644 --- a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/AbstractKeycloakIntegrationIndexingServiceIT.java +++ b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/AbstractKeycloakIntegrationIndexingServiceIT.java @@ -20,7 +20,6 @@ import org.eclipse.microprofile.config.inject.ConfigProperty; import org.junit.jupiter.api.Test; -import org.keycloak.representations.AccessTokenResponse; import org.kie.kogito.testcontainers.KogitoKeycloakContainer; import org.kie.kogito.testcontainers.quarkus.KeycloakQuarkusTestResource; @@ -97,6 +96,6 @@ private String getAccessToken(String userName) { .param("client_secret", KogitoKeycloakContainer.CLIENT_SECRET) .when() .post(keycloakURL + "/protocol/openid-connect/token") - .as(AccessTokenResponse.class).getToken(); + .jsonPath().get("access_token"); } } diff --git a/data-index/data-index-service/data-index-service-infinispan/pom.xml b/data-index/data-index-service/data-index-service-infinispan/pom.xml index d9134e9cef..375cdf8cc1 100644 --- a/data-index/data-index-service/data-index-service-infinispan/pom.xml +++ b/data-index/data-index-service/data-index-service-infinispan/pom.xml @@ -101,11 +101,6 @@ kogito-quarkus-test-utils test - - org.keycloak - keycloak-core - test - org.awaitility awaitility diff --git a/data-index/data-index-service/data-index-service-inmemory/pom.xml b/data-index/data-index-service/data-index-service-inmemory/pom.xml index 9b1586fbcd..4dd51a953a 100644 --- a/data-index/data-index-service/data-index-service-inmemory/pom.xml +++ b/data-index/data-index-service/data-index-service-inmemory/pom.xml @@ -89,11 +89,6 @@ kogito-quarkus-test-utils test - - org.keycloak - keycloak-core - test - org.awaitility awaitility diff --git a/data-index/data-index-service/data-index-service-mongodb/pom.xml b/data-index/data-index-service/data-index-service-mongodb/pom.xml index 118314743f..7c2ead3652 100644 --- a/data-index/data-index-service/data-index-service-mongodb/pom.xml +++ b/data-index/data-index-service/data-index-service-mongodb/pom.xml @@ -95,11 +95,6 @@ kogito-quarkus-test-utils test - - org.keycloak - keycloak-core - test - org.awaitility awaitility diff --git a/data-index/data-index-service/data-index-service-postgresql/pom.xml b/data-index/data-index-service/data-index-service-postgresql/pom.xml index 4db0252d0c..43f999c6fa 100644 --- a/data-index/data-index-service/data-index-service-postgresql/pom.xml +++ b/data-index/data-index-service/data-index-service-postgresql/pom.xml @@ -94,11 +94,6 @@ kogito-quarkus-test-utils test - - org.keycloak - keycloak-core - test - org.awaitility awaitility diff --git a/explainability/explainability-service-rest/pom.xml b/explainability/explainability-service-rest/pom.xml index 6f0e7f1d0f..cb1f027812 100644 --- a/explainability/explainability-service-rest/pom.xml +++ b/explainability/explainability-service-rest/pom.xml @@ -86,11 +86,6 @@ kogito-quarkus-test-utils test - - org.keycloak - keycloak-core - test - diff --git a/explainability/explainability-service-rest/src/test/java/org/kie/kogito/explainability/rest/KeycloakExplainabilityServiceIT.java b/explainability/explainability-service-rest/src/test/java/org/kie/kogito/explainability/rest/KeycloakExplainabilityServiceIT.java index ee532e9153..d014777d8f 100644 --- a/explainability/explainability-service-rest/src/test/java/org/kie/kogito/explainability/rest/KeycloakExplainabilityServiceIT.java +++ b/explainability/explainability-service-rest/src/test/java/org/kie/kogito/explainability/rest/KeycloakExplainabilityServiceIT.java @@ -20,7 +20,6 @@ import org.apache.http.HttpStatus; import org.junit.jupiter.api.Test; -import org.keycloak.representations.AccessTokenResponse; import org.kie.kogito.test.quarkus.QuarkusTestProperty; import org.kie.kogito.testcontainers.KogitoKeycloakContainer; import org.kie.kogito.testcontainers.quarkus.KeycloakQuarkusTestResource; @@ -65,6 +64,6 @@ private String getAccessToken(String userName) { .param("client_secret", KogitoKeycloakContainer.CLIENT_SECRET) .when() .post(keycloakURL + "/protocol/openid-connect/token") - .as(AccessTokenResponse.class).getToken(); + .jsonPath().get("access_token"); } } diff --git a/jobs-service/jobs-service-common/pom.xml b/jobs-service/jobs-service-common/pom.xml index cdfc82a41a..6b19b74d56 100644 --- a/jobs-service/jobs-service-common/pom.xml +++ b/jobs-service/jobs-service-common/pom.xml @@ -163,11 +163,6 @@ rest-assured test - - org.keycloak - keycloak-core - test - org.mockito mockito-junit-jupiter diff --git a/jobs-service/jobs-service-common/src/test/java/org/kie/kogito/jobs/service/resource/BaseKeycloakJobServiceTest.java b/jobs-service/jobs-service-common/src/test/java/org/kie/kogito/jobs/service/resource/BaseKeycloakJobServiceTest.java index 617efe207c..1a2d56764e 100644 --- a/jobs-service/jobs-service-common/src/test/java/org/kie/kogito/jobs/service/resource/BaseKeycloakJobServiceTest.java +++ b/jobs-service/jobs-service-common/src/test/java/org/kie/kogito/jobs/service/resource/BaseKeycloakJobServiceTest.java @@ -24,7 +24,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.keycloak.representations.AccessTokenResponse; import org.kie.kogito.jobs.api.Job; import org.kie.kogito.jobs.api.JobBuilder; import org.kie.kogito.jobs.service.model.JobStatus; @@ -234,6 +233,6 @@ private String getAccessToken(String userName) { .param("client_secret", KogitoKeycloakContainer.CLIENT_SECRET) .when() .post(keycloakURL + "/protocol/openid-connect/token") - .as(AccessTokenResponse.class).getToken(); + .jsonPath().get("access_token"); } } diff --git a/jobs-service/jobs-service-infinispan/pom.xml b/jobs-service/jobs-service-infinispan/pom.xml index a5bfaed242..df8231b831 100644 --- a/jobs-service/jobs-service-infinispan/pom.xml +++ b/jobs-service/jobs-service-infinispan/pom.xml @@ -114,11 +114,6 @@ rest-assured test - - org.keycloak - keycloak-core - test - com.github.tomakehurst wiremock-jre8 diff --git a/jobs-service/jobs-service-inmemory/pom.xml b/jobs-service/jobs-service-inmemory/pom.xml index 70d047a98b..8ab200e963 100644 --- a/jobs-service/jobs-service-inmemory/pom.xml +++ b/jobs-service/jobs-service-inmemory/pom.xml @@ -107,11 +107,6 @@ rest-assured test - - org.keycloak - keycloak-core - test - com.github.tomakehurst wiremock-jre8 diff --git a/jobs-service/jobs-service-mongodb/pom.xml b/jobs-service/jobs-service-mongodb/pom.xml index 3830fcb196..45018a9d47 100644 --- a/jobs-service/jobs-service-mongodb/pom.xml +++ b/jobs-service/jobs-service-mongodb/pom.xml @@ -101,11 +101,6 @@ rest-assured test - - org.keycloak - keycloak-core - test - com.github.tomakehurst wiremock-jre8 diff --git a/jobs-service/jobs-service-postgresql-common/pom.xml b/jobs-service/jobs-service-postgresql-common/pom.xml index ab5b3eac63..a88b981d04 100644 --- a/jobs-service/jobs-service-postgresql-common/pom.xml +++ b/jobs-service/jobs-service-postgresql-common/pom.xml @@ -99,11 +99,6 @@ rest-assured test - - org.keycloak - keycloak-core - test - com.github.tomakehurst wiremock-jre8 diff --git a/jobs-service/jobs-service-storage-jpa/pom.xml b/jobs-service/jobs-service-storage-jpa/pom.xml index b49d36ce73..99de150744 100644 --- a/jobs-service/jobs-service-storage-jpa/pom.xml +++ b/jobs-service/jobs-service-storage-jpa/pom.xml @@ -113,11 +113,6 @@ rest-assured test - - org.keycloak - keycloak-core - test - com.github.tomakehurst wiremock-jre8 diff --git a/security-commons/pom.xml b/security-commons/pom.xml index 4e1705ec57..a26cb5abd4 100644 --- a/security-commons/pom.xml +++ b/security-commons/pom.xml @@ -53,11 +53,6 @@ kogito-quarkus-test-utils test - - org.keycloak - keycloak-core - test - io.quarkus quarkus-junit5 diff --git a/security-commons/src/test/java/org/kie/kogito/security/KeycloakSecurityCommonsServiceIT.java b/security-commons/src/test/java/org/kie/kogito/security/KeycloakSecurityCommonsServiceIT.java index a013593b8c..9e238e7fed 100644 --- a/security-commons/src/test/java/org/kie/kogito/security/KeycloakSecurityCommonsServiceIT.java +++ b/security-commons/src/test/java/org/kie/kogito/security/KeycloakSecurityCommonsServiceIT.java @@ -19,7 +19,6 @@ package org.kie.kogito.security; import org.junit.jupiter.api.Test; -import org.keycloak.representations.AccessTokenResponse; import org.kie.kogito.test.quarkus.QuarkusTestProperty; import org.kie.kogito.testcontainers.KogitoKeycloakContainer; import org.kie.kogito.testcontainers.quarkus.KeycloakQuarkusTestResource; @@ -74,6 +73,6 @@ private String getAccessToken(String userName) { .param("client_secret", KogitoKeycloakContainer.CLIENT_SECRET) .when() .post(keycloakURL + "/protocol/openid-connect/token") - .as(AccessTokenResponse.class).getToken(); + .jsonPath().get("access_token"); } } diff --git a/trusty/trusty-service/trusty-service-common/pom.xml b/trusty/trusty-service/trusty-service-common/pom.xml index f58205a872..8c53ec2e92 100644 --- a/trusty/trusty-service/trusty-service-common/pom.xml +++ b/trusty/trusty-service/trusty-service-common/pom.xml @@ -124,11 +124,6 @@ awaitility test - - org.keycloak - keycloak-core - test - org.skyscreamer jsonassert diff --git a/trusty/trusty-service/trusty-service-common/src/test/java/org/kie/kogito/trusty/service/common/KeycloakTrustyServiceIT.java b/trusty/trusty-service/trusty-service-common/src/test/java/org/kie/kogito/trusty/service/common/KeycloakTrustyServiceIT.java index c860f37841..6fb21ddff6 100644 --- a/trusty/trusty-service/trusty-service-common/src/test/java/org/kie/kogito/trusty/service/common/KeycloakTrustyServiceIT.java +++ b/trusty/trusty-service/trusty-service-common/src/test/java/org/kie/kogito/trusty/service/common/KeycloakTrustyServiceIT.java @@ -24,7 +24,6 @@ import org.apache.http.HttpStatus; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.keycloak.representations.AccessTokenResponse; import org.kie.kogito.test.quarkus.QuarkusTestProperty; import org.kie.kogito.testcontainers.KogitoKeycloakContainer; import org.kie.kogito.testcontainers.quarkus.KeycloakQuarkusTestResource; @@ -77,6 +76,6 @@ private String getAccessToken(String userName) { .param("client_secret", KogitoKeycloakContainer.CLIENT_SECRET) .when() .post(keycloakURL + "/protocol/openid-connect/token") - .as(AccessTokenResponse.class).getToken(); + .jsonPath().get("access_token"); } }