From 6c14f1e46517dcdacd5b1e1e3041b20e2463459d Mon Sep 17 00:00:00 2001 From: mariofusco Date: Mon, 27 Nov 2023 09:50:56 +0100 Subject: [PATCH] Revert "downgrade spring-boot version in order to make it java 11 compatible" This reverts commit f2b546de5e98323c4058801c458d80e036dedbfb. --- kogito-build/kogito-dependencies-bom/pom.xml | 2 +- .../decision/SpringBootEventDrivenDecisionController.java | 3 +-- .../events/mongodb/SpringbootMongoDBEventPublisher.java | 3 +-- .../SpringBootEventDrivenPredictionsController.java | 3 +-- .../jobs/management/springboot/SpringRestJobsService.java | 3 ++- .../spring/SpringBootKogitoExtensionInitializer.java | 3 +-- .../cloudevents/spring/SpringKafkaCloudEventEmitter.java | 1 - .../cloudevents/spring/SpringKafkaCloudEventReceiver.java | 3 +-- .../core/springboot/SpringbootMetricsInterceptor.java | 4 ++-- .../core/springboot/SpringMetricsInterceptorTest.java | 4 ++-- 10 files changed, 12 insertions(+), 17 deletions(-) diff --git a/kogito-build/kogito-dependencies-bom/pom.xml b/kogito-build/kogito-dependencies-bom/pom.xml index 150318f910d..8af3d4bfafb 100644 --- a/kogito-build/kogito-dependencies-bom/pom.xml +++ b/kogito-build/kogito-dependencies-bom/pom.xml @@ -18,7 +18,7 @@ 3.5.2 ${version.io.quarkus} - 2.6.6 + 3.0.5 3.5.1 diff --git a/springboot/addons/events/decisions/src/main/java/org/kie/kogito/eventdriven/decision/SpringBootEventDrivenDecisionController.java b/springboot/addons/events/decisions/src/main/java/org/kie/kogito/eventdriven/decision/SpringBootEventDrivenDecisionController.java index b48f221fe95..9b38468d832 100644 --- a/springboot/addons/events/decisions/src/main/java/org/kie/kogito/eventdriven/decision/SpringBootEventDrivenDecisionController.java +++ b/springboot/addons/events/decisions/src/main/java/org/kie/kogito/eventdriven/decision/SpringBootEventDrivenDecisionController.java @@ -18,6 +18,7 @@ */ package org.kie.kogito.eventdriven.decision; +import jakarta.annotation.PostConstruct; import org.kie.kogito.config.ConfigBean; import org.kie.kogito.decision.DecisionModels; import org.kie.kogito.event.EventEmitter; @@ -25,8 +26,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import jakarta.annotation.PostConstruct; - @Component public class SpringBootEventDrivenDecisionController extends EventDrivenDecisionController { diff --git a/springboot/addons/events/mongodb/src/main/java/org/kie/kogito/events/mongodb/SpringbootMongoDBEventPublisher.java b/springboot/addons/events/mongodb/src/main/java/org/kie/kogito/events/mongodb/SpringbootMongoDBEventPublisher.java index 5fb16d922f2..e08186b6510 100644 --- a/springboot/addons/events/mongodb/src/main/java/org/kie/kogito/events/mongodb/SpringbootMongoDBEventPublisher.java +++ b/springboot/addons/events/mongodb/src/main/java/org/kie/kogito/events/mongodb/SpringbootMongoDBEventPublisher.java @@ -18,6 +18,7 @@ */ package org.kie.kogito.events.mongodb; +import jakarta.annotation.PostConstruct; import org.kie.kogito.mongodb.transaction.AbstractTransactionManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -25,8 +26,6 @@ import com.mongodb.client.MongoClient; -import jakarta.annotation.PostConstruct; - @Component public class SpringbootMongoDBEventPublisher extends MongoDBEventPublisher { diff --git a/springboot/addons/events/predictions/src/main/java/org/kie/kogito/eventdriven/predictions/SpringBootEventDrivenPredictionsController.java b/springboot/addons/events/predictions/src/main/java/org/kie/kogito/eventdriven/predictions/SpringBootEventDrivenPredictionsController.java index c6fc5a3a662..14a6d41dfca 100644 --- a/springboot/addons/events/predictions/src/main/java/org/kie/kogito/eventdriven/predictions/SpringBootEventDrivenPredictionsController.java +++ b/springboot/addons/events/predictions/src/main/java/org/kie/kogito/eventdriven/predictions/SpringBootEventDrivenPredictionsController.java @@ -18,6 +18,7 @@ */ package org.kie.kogito.eventdriven.predictions; +import jakarta.annotation.PostConstruct; import org.kie.kogito.config.ConfigBean; import org.kie.kogito.event.EventEmitter; import org.kie.kogito.event.EventReceiver; @@ -25,8 +26,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import jakarta.annotation.PostConstruct; - @Component public class SpringBootEventDrivenPredictionsController extends EventDrivenPredictionsController { diff --git a/springboot/addons/jobs/src/main/java/org/kie/kogito/jobs/management/springboot/SpringRestJobsService.java b/springboot/addons/jobs/src/main/java/org/kie/kogito/jobs/management/springboot/SpringRestJobsService.java index a4902cead81..59eddb3c70e 100644 --- a/springboot/addons/jobs/src/main/java/org/kie/kogito/jobs/management/springboot/SpringRestJobsService.java +++ b/springboot/addons/jobs/src/main/java/org/kie/kogito/jobs/management/springboot/SpringRestJobsService.java @@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatusCode; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; @@ -85,7 +86,7 @@ public String scheduleProcessInstanceJob(ProcessInstanceJobDescription descripti ResponseEntity result = restTemplate.postForEntity(getJobsServiceUri(), request, String.class); - if (result.getStatusCode().ordinal() == 200) { + if (result.getStatusCode().isSameCodeAs(HttpStatusCode.valueOf(200))) { LOGGER.debug("Creating of the job {} done with status code {} ", job, result.getStatusCode()); } return job.getId(); diff --git a/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringBootKogitoExtensionInitializer.java b/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringBootKogitoExtensionInitializer.java index ddcefb65ea0..4264e3fd482 100644 --- a/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringBootKogitoExtensionInitializer.java +++ b/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringBootKogitoExtensionInitializer.java @@ -18,6 +18,7 @@ */ package org.kie.kogito.addon.cloudevents.spring; +import jakarta.annotation.PostConstruct; import org.kie.kogito.event.cloudevents.extension.KogitoExtension; import org.kie.kogito.event.cloudevents.extension.KogitoPredictionsExtension; import org.kie.kogito.event.cloudevents.extension.KogitoProcessExtension; @@ -31,8 +32,6 @@ import io.cloudevents.jackson.JsonFormat; -import jakarta.annotation.PostConstruct; - /** * The goal of this bean is to register the Kogito CloudEvent extension * that allows the system to correctly parse Kogito extension attributes. diff --git a/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringKafkaCloudEventEmitter.java b/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringKafkaCloudEventEmitter.java index 279b589211b..ad1edac7c69 100644 --- a/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringKafkaCloudEventEmitter.java +++ b/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringKafkaCloudEventEmitter.java @@ -64,7 +64,6 @@ public CompletionStage emit(DataEvent event) { env.getProperty("kogito.addon.cloudevents.kafka." + KogitoEventStreams.OUTGOING + "." + event.getType(), defaultTopicName), configBean.useCloudEvents() ? ceMarshaller.marshall(event.asCloudEvent(ceMarshaller.cloudEventDataFactory())) : marshaller.marshall(event.getData())) - .completable() .thenApply(r -> null); } catch (IOException e) { throw new UncheckedIOException(e); diff --git a/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringKafkaCloudEventReceiver.java b/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringKafkaCloudEventReceiver.java index a009f26c5a8..5330d48cc8b 100644 --- a/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringKafkaCloudEventReceiver.java +++ b/springboot/addons/messaging/implementation/src/main/java/org/kie/kogito/addon/cloudevents/spring/SpringKafkaCloudEventReceiver.java @@ -26,6 +26,7 @@ import java.util.concurrent.ExecutionException; import java.util.function.Function; +import jakarta.annotation.PostConstruct; import org.kie.kogito.config.ConfigBean; import org.kie.kogito.event.CloudEventUnmarshallerFactory; import org.kie.kogito.event.DataEvent; @@ -42,8 +43,6 @@ import org.springframework.messaging.handler.annotation.Payload; import org.springframework.stereotype.Component; -import jakarta.annotation.PostConstruct; - @Component public class SpringKafkaCloudEventReceiver implements EventReceiver { diff --git a/springboot/addons/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/springboot/SpringbootMetricsInterceptor.java b/springboot/addons/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/springboot/SpringbootMetricsInterceptor.java index 8428936c053..14b64f3ab4d 100644 --- a/springboot/addons/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/springboot/SpringbootMetricsInterceptor.java +++ b/springboot/addons/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/springboot/SpringbootMetricsInterceptor.java @@ -18,8 +18,8 @@ */ package org.kie.kogito.monitoring.core.springboot; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.kie.kogito.monitoring.core.common.system.interceptor.MetricsInterceptor; import org.springframework.lang.Nullable; diff --git a/springboot/addons/monitoring/core/src/test/java/org/kie/kogito/monitoring/core/springboot/SpringMetricsInterceptorTest.java b/springboot/addons/monitoring/core/src/test/java/org/kie/kogito/monitoring/core/springboot/SpringMetricsInterceptorTest.java index 761ce48615d..f1f7063f330 100644 --- a/springboot/addons/monitoring/core/src/test/java/org/kie/kogito/monitoring/core/springboot/SpringMetricsInterceptorTest.java +++ b/springboot/addons/monitoring/core/src/test/java/org/kie/kogito/monitoring/core/springboot/SpringMetricsInterceptorTest.java @@ -20,8 +20,8 @@ import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; import org.kie.kogito.monitoring.core.common.system.interceptor.MetricsInterceptor;