diff --git a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/CallbackResource.java b/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/CallbackResource.java index 30abcfa768..ed9f08704e 100644 --- a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/CallbackResource.java +++ b/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/CallbackResource.java @@ -18,30 +18,26 @@ */ package org.kie.kogito.examples; -import java.net.URI; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.UUID; - +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.vertx.core.Vertx; +import io.vertx.ext.web.client.WebClient; +import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; import jakarta.ws.rs.core.MediaType; - -import jakarta.annotation.PostConstruct; +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.UUID; import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.core.builder.CloudEventBuilder; -import io.vertx.core.Vertx; -import io.vertx.ext.web.client.WebClient; - @ApplicationScoped @Path("/event") public class CallbackResource { diff --git a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/RegisterObjectMapper.java b/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/RegisterObjectMapper.java index 75e227dc9f..6412016e4c 100644 --- a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/RegisterObjectMapper.java +++ b/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/RegisterObjectMapper.java @@ -18,12 +18,10 @@ */ package org.kie.kogito.examples; -import jakarta.enterprise.context.ApplicationScoped; - import com.fasterxml.jackson.databind.ObjectMapper; - import io.cloudevents.jackson.JsonFormat; import io.quarkus.jackson.ObjectMapperCustomizer; +import jakarta.enterprise.context.ApplicationScoped; @ApplicationScoped public class RegisterObjectMapper implements ObjectMapperCustomizer{ @@ -32,4 +30,4 @@ public class RegisterObjectMapper implements ObjectMapperCustomizer{ public void customize(ObjectMapper objectMapper) { objectMapper.registerModule(JsonFormat.getCloudEventJacksonModule()); } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-workflow/src/test/java/org/kie/kogito/examples/CallbackRestIT.java b/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-workflow/src/test/java/org/kie/kogito/examples/CallbackRestIT.java index a70456ebfb..e9b82df8f4 100644 --- a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-workflow/src/test/java/org/kie/kogito/examples/CallbackRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-workflow/src/test/java/org/kie/kogito/examples/CallbackRestIT.java @@ -18,24 +18,23 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.RestAssured; -import io.restassured.http.ContentType; -import com.github.tomakehurst.wiremock.WireMockServer; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; - import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static io.restassured.RestAssured.given; import static org.wiremock.webhooks.Webhooks.*; -import org.junit.jupiter.api.BeforeEach; -import org.wiremock.webhooks.Webhooks; +import com.github.tomakehurst.wiremock.WireMockServer; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.RestAssured; +import io.restassured.http.ContentType; import java.util.Collections; import java.util.UUID; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.wiremock.webhooks.Webhooks; @QuarkusIntegrationTest public class CallbackRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java b/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java index d9981b0118..6151660ab6 100644 --- a/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java +++ b/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java @@ -18,16 +18,20 @@ */ package org.kie.kogito.examples; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.CloudEvent; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.jackson.JsonCloudEventData; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.net.URI; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Optional; import java.util.UUID; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - import org.eclipse.microprofile.reactive.messaging.Acknowledgment; import org.eclipse.microprofile.reactive.messaging.Acknowledgment.Strategy; import org.eclipse.microprofile.reactive.messaging.Incoming; @@ -39,14 +43,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.CloudEvent; -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.jackson.JsonCloudEventData; - @ApplicationScoped public class PrintService { diff --git a/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/test/java/org/kie/kogito/examples/CallbackRestIT.java b/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/test/java/org/kie/kogito/examples/CallbackRestIT.java index 4e1c803c0a..a8930aa60e 100644 --- a/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/test/java/org/kie/kogito/examples/CallbackRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/test/java/org/kie/kogito/examples/CallbackRestIT.java @@ -18,15 +18,14 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.awaitility.Awaitility.await; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static java.util.concurrent.TimeUnit.SECONDS; -import static org.awaitility.Awaitility.await; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest class CallbackRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-compensation-quarkus/src/test/java/org/kie/kogito/examples/CompensationRestIT.java b/serverless-workflow-examples/serverless-workflow-compensation-quarkus/src/test/java/org/kie/kogito/examples/CompensationRestIT.java index 095aa5841f..bd5a7b5954 100644 --- a/serverless-workflow-examples/serverless-workflow-compensation-quarkus/src/test/java/org/kie/kogito/examples/CompensationRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-compensation-quarkus/src/test/java/org/kie/kogito/examples/CompensationRestIT.java @@ -18,13 +18,12 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest public class CompensationRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/src/test/java/org/kie/kogito/examples/ConsumingEventsOverHttpIT.java b/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/src/test/java/org/kie/kogito/examples/ConsumingEventsOverHttpIT.java index 8a981fe2ac..6a62a83c4b 100644 --- a/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/src/test/java/org/kie/kogito/examples/ConsumingEventsOverHttpIT.java +++ b/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/src/test/java/org/kie/kogito/examples/ConsumingEventsOverHttpIT.java @@ -18,29 +18,26 @@ */ package org.kie.kogito.examples; -import java.net.URI; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; -import java.util.UUID; - -import io.restassured.response.ExtractableResponse; -import io.restassured.response.Response; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.awaitility.Awaitility.await; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.ObjectMapper; - import io.cloudevents.core.builder.CloudEventBuilder; import io.cloudevents.jackson.JsonFormat; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static java.util.concurrent.TimeUnit.SECONDS; -import static org.awaitility.Awaitility.await; +import io.restassured.response.ExtractableResponse; +import io.restassured.response.Response; +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; +import java.util.UUID; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest class ConsumingEventsOverHttpIT { diff --git a/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/main/java/org/kie/kogito/examples/EventsService.java b/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/main/java/org/kie/kogito/examples/EventsService.java index 004e81d958..9d2861c386 100644 --- a/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/main/java/org/kie/kogito/examples/EventsService.java +++ b/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/main/java/org/kie/kogito/examples/EventsService.java @@ -18,16 +18,20 @@ */ package org.kie.kogito.examples; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.CloudEvent; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.jackson.JsonCloudEventData; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.net.URI; import java.time.OffsetDateTime; import java.util.Map; import java.util.Optional; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - import org.eclipse.microprofile.reactive.messaging.Acknowledgment; import org.eclipse.microprofile.reactive.messaging.Acknowledgment.Strategy; import org.eclipse.microprofile.reactive.messaging.Incoming; @@ -38,14 +42,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.CloudEvent; -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.jackson.JsonCloudEventData; - @ApplicationScoped public class EventsService { diff --git a/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/main/java/org/kie/kogito/examples/WorkflowResource.java b/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/main/java/org/kie/kogito/examples/WorkflowResource.java index de6af279ab..f46352db90 100644 --- a/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/main/java/org/kie/kogito/examples/WorkflowResource.java +++ b/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/main/java/org/kie/kogito/examples/WorkflowResource.java @@ -18,27 +18,23 @@ */ package org.kie.kogito.examples; -import java.net.URI; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; -import java.util.UUID; - +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.core.builder.CloudEventBuilder; import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; import jakarta.ws.rs.PathParam; import jakarta.ws.rs.core.Response; - +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; +import java.util.UUID; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Emitter; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.core.builder.CloudEventBuilder; - /** * Helper class used to facilitate testing using REST */ diff --git a/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/test/java/org/kie/kogito/examples/CorrelationIT.java b/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/test/java/org/kie/kogito/examples/CorrelationIT.java index 9f8a24fcba..9cd5e76327 100644 --- a/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/test/java/org/kie/kogito/examples/CorrelationIT.java +++ b/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/src/test/java/org/kie/kogito/examples/CorrelationIT.java @@ -18,19 +18,17 @@ */ package org.kie.kogito.examples; -import java.util.concurrent.atomic.AtomicReference; - -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.SECONDS; import static org.awaitility.Awaitility.await; import static org.hamcrest.Matchers.notNullValue; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class CorrelationIT { diff --git a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/EventsService.java b/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/EventsService.java index 004e81d958..9d2861c386 100644 --- a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/EventsService.java +++ b/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/EventsService.java @@ -18,16 +18,20 @@ */ package org.kie.kogito.examples; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.CloudEvent; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.jackson.JsonCloudEventData; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.net.URI; import java.time.OffsetDateTime; import java.util.Map; import java.util.Optional; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - import org.eclipse.microprofile.reactive.messaging.Acknowledgment; import org.eclipse.microprofile.reactive.messaging.Acknowledgment.Strategy; import org.eclipse.microprofile.reactive.messaging.Incoming; @@ -38,14 +42,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.CloudEvent; -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.jackson.JsonCloudEventData; - @ApplicationScoped public class EventsService { diff --git a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/WorkflowResource.java b/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/WorkflowResource.java index de6af279ab..f46352db90 100644 --- a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/WorkflowResource.java +++ b/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/WorkflowResource.java @@ -18,27 +18,23 @@ */ package org.kie.kogito.examples; -import java.net.URI; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; -import java.util.UUID; - +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.core.builder.CloudEventBuilder; import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; import jakarta.ws.rs.PathParam; import jakarta.ws.rs.core.Response; - +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; +import java.util.UUID; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Emitter; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.core.builder.CloudEventBuilder; - /** * Helper class used to facilitate testing using REST */ diff --git a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/test/java/org/kie/kogito/examples/CorrelationIT.java b/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/test/java/org/kie/kogito/examples/CorrelationIT.java index 9f8a24fcba..9cd5e76327 100644 --- a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/test/java/org/kie/kogito/examples/CorrelationIT.java +++ b/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/test/java/org/kie/kogito/examples/CorrelationIT.java @@ -18,19 +18,17 @@ */ package org.kie.kogito.examples; -import java.util.concurrent.atomic.AtomicReference; - -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.SECONDS; import static org.awaitility.Awaitility.await; import static org.hamcrest.Matchers.notNullValue; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class CorrelationIT { diff --git a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-deployment/src/main/java/org/kie/kogito/examples/sw/services/RPCCustomFunctionNamespace.java b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-deployment/src/main/java/org/kie/kogito/examples/sw/services/RPCCustomFunctionNamespace.java index 6ed7e9657e..c4043be46d 100644 --- a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-deployment/src/main/java/org/kie/kogito/examples/sw/services/RPCCustomFunctionNamespace.java +++ b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-deployment/src/main/java/org/kie/kogito/examples/sw/services/RPCCustomFunctionNamespace.java @@ -18,18 +18,17 @@ */ package org.kie.kogito.examples.sw.services; +import static org.kie.kogito.examples.sw.custom.RPCCustomWorkItemHandler.NAME; +import static org.kie.kogito.examples.sw.custom.RPCCustomWorkItemHandler.OPERATION; +import static org.kie.kogito.serverless.workflow.parser.FunctionNamespaceFactory.getFunctionName; + +import io.serverlessworkflow.api.Workflow; +import io.serverlessworkflow.api.functions.FunctionRef; import org.jbpm.ruleflow.core.RuleFlowNodeContainerFactory; import org.jbpm.ruleflow.core.factory.WorkItemNodeFactory; import org.kie.kogito.serverless.workflow.functions.WorkItemFunctionNamespace; import org.kie.kogito.serverless.workflow.parser.ParserContext; -import io.serverlessworkflow.api.Workflow; -import io.serverlessworkflow.api.functions.FunctionRef; - -import static org.kie.kogito.examples.sw.custom.RPCCustomWorkItemHandler.NAME; -import static org.kie.kogito.examples.sw.custom.RPCCustomWorkItemHandler.OPERATION; -import static org.kie.kogito.serverless.workflow.parser.FunctionNamespaceFactory.getFunctionName; - public class RPCCustomFunctionNamespace extends WorkItemFunctionNamespace{ @Override diff --git a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-deployment/src/main/java/org/kie/kogito/examples/sw/services/RPCCustomTypeHandler.java b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-deployment/src/main/java/org/kie/kogito/examples/sw/services/RPCCustomTypeHandler.java index fc276aa71e..e5705fe327 100644 --- a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-deployment/src/main/java/org/kie/kogito/examples/sw/services/RPCCustomTypeHandler.java +++ b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-deployment/src/main/java/org/kie/kogito/examples/sw/services/RPCCustomTypeHandler.java @@ -18,18 +18,17 @@ */ package org.kie.kogito.examples.sw.services; +import static org.kie.kogito.examples.sw.custom.RPCCustomWorkItemHandler.NAME; +import static org.kie.kogito.examples.sw.custom.RPCCustomWorkItemHandler.OPERATION; +import static org.kie.kogito.serverless.workflow.parser.FunctionTypeHandlerFactory.trimCustomOperation; + +import io.serverlessworkflow.api.Workflow; +import io.serverlessworkflow.api.functions.FunctionDefinition; import org.jbpm.ruleflow.core.RuleFlowNodeContainerFactory; import org.jbpm.ruleflow.core.factory.WorkItemNodeFactory; import org.kie.kogito.serverless.workflow.parser.ParserContext; import org.kie.kogito.serverless.workflow.parser.types.WorkItemTypeHandler; -import io.serverlessworkflow.api.Workflow; -import io.serverlessworkflow.api.functions.FunctionDefinition; - -import static org.kie.kogito.examples.sw.custom.RPCCustomWorkItemHandler.NAME; -import static org.kie.kogito.examples.sw.custom.RPCCustomWorkItemHandler.OPERATION; -import static org.kie.kogito.serverless.workflow.parser.FunctionTypeHandlerFactory.trimCustomOperation; - public class RPCCustomTypeHandler extends WorkItemTypeHandler{ diff --git a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-server/src/main/java/org/kie/kogito/examples/sw/custom/CalculatorServer.java b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-server/src/main/java/org/kie/kogito/examples/sw/custom/CalculatorServer.java index 75759febaf..4687ec3e94 100644 --- a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-server/src/main/java/org/kie/kogito/examples/sw/custom/CalculatorServer.java +++ b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-server/src/main/java/org/kie/kogito/examples/sw/custom/CalculatorServer.java @@ -24,11 +24,9 @@ import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - public class CalculatorServer implements Runnable, Closeable { private static final Logger logger = LoggerFactory.getLogger(CalculatorServer.class); diff --git a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-server/src/test/java/org/kie/kogito/examples/sw/custom/CalculatorClientTest.java b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-server/src/test/java/org/kie/kogito/examples/sw/custom/CalculatorClientTest.java index 18caa33b66..5a61ff2773 100644 --- a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-server/src/test/java/org/kie/kogito/examples/sw/custom/CalculatorClientTest.java +++ b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc-server/src/test/java/org/kie/kogito/examples/sw/custom/CalculatorClientTest.java @@ -18,15 +18,14 @@ */ package org.kie.kogito.examples.sw.custom; -import java.io.IOException; +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.io.IOException; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.kie.kogito.examples.sw.custom.CalculatorClient.OperationId; -import static org.junit.jupiter.api.Assertions.assertEquals; - public class CalculatorClientTest { diff --git a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandler.java b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandler.java index 87dc724411..d584c409d8 100644 --- a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandler.java +++ b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandler.java @@ -18,13 +18,11 @@ */ package org.kie.kogito.examples.sw.custom; +import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; import java.io.UncheckedIOException; import java.util.Iterator; import java.util.Map; - -import jakarta.enterprise.context.ApplicationScoped; - import org.kie.kogito.examples.sw.custom.CalculatorClient.OperationId; import org.kie.kogito.internal.process.workitem.KogitoWorkItem; import org.kie.kogito.serverless.workflow.WorkflowWorkItemHandler; diff --git a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandlerConfig.java b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandlerConfig.java index d33a90b6ca..fce6435974 100644 --- a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandlerConfig.java +++ b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandlerConfig.java @@ -19,13 +19,10 @@ package org.kie.kogito.examples.sw.custom; import jakarta.annotation.PostConstruct; - import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; - import org.kie.kogito.process.impl.CachedWorkItemHandlerConfig; - @ApplicationScoped public class RPCCustomWorkItemHandlerConfig extends CachedWorkItemHandlerConfig { diff --git a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-type-example/src/test/java/org/kie/kogito/examples/CustomRestIT.java b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-type-example/src/test/java/org/kie/kogito/examples/CustomRestIT.java index 1f5daa5827..27b1001f60 100644 --- a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-type-example/src/test/java/org/kie/kogito/examples/CustomRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-type-example/src/test/java/org/kie/kogito/examples/CustomRestIT.java @@ -18,21 +18,19 @@ */ package org.kie.kogito.examples; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; + +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; import java.io.IOException; import java.util.Map; - import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.kie.kogito.examples.sw.custom.CalculatorServer; import org.kie.kogito.serverless.workflow.SWFConstants; -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; - @QuarkusIntegrationTest class CustomRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-data-index-persistence-addon-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java b/serverless-workflow-examples/serverless-workflow-data-index-persistence-addon-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java index 784f4f8cfa..fdd8d69fb4 100644 --- a/serverless-workflow-examples/serverless-workflow-data-index-persistence-addon-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-data-index-persistence-addon-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java @@ -18,18 +18,17 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.RestAssured; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static java.util.concurrent.TimeUnit.SECONDS; import static org.awaitility.Awaitility.await; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.RestAssured; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class DataIndexRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java b/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java index d9981b0118..6151660ab6 100644 --- a/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java +++ b/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java @@ -18,16 +18,20 @@ */ package org.kie.kogito.examples; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.CloudEvent; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.jackson.JsonCloudEventData; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.net.URI; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Optional; import java.util.UUID; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - import org.eclipse.microprofile.reactive.messaging.Acknowledgment; import org.eclipse.microprofile.reactive.messaging.Acknowledgment.Strategy; import org.eclipse.microprofile.reactive.messaging.Incoming; @@ -39,14 +43,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.CloudEvent; -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.jackson.JsonCloudEventData; - @ApplicationScoped public class PrintService { diff --git a/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java b/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java index 382d102f96..3bc9f86553 100644 --- a/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/test/java/org/kie/kogito/examples/DataIndexRestIT.java @@ -18,18 +18,17 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.RestAssured; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static java.util.concurrent.TimeUnit.SECONDS; import static org.awaitility.Awaitility.await; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.RestAssured; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class DataIndexRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-dmn-quarkus/src/test/java/org/kie/kogito/examples/DMNGreetRestIT.java b/serverless-workflow-examples/serverless-workflow-dmn-quarkus/src/test/java/org/kie/kogito/examples/DMNGreetRestIT.java index 0d13fc98cc..bb8d274f9b 100644 --- a/serverless-workflow-examples/serverless-workflow-dmn-quarkus/src/test/java/org/kie/kogito/examples/DMNGreetRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-dmn-quarkus/src/test/java/org/kie/kogito/examples/DMNGreetRestIT.java @@ -18,15 +18,14 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.Matchers.is; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class DMNGreetRestIT { @Test diff --git a/serverless-workflow-examples/serverless-workflow-error-quarkus/src/main/java/org/kie/kogito/examples/PublishRestService.java b/serverless-workflow-examples/serverless-workflow-error-quarkus/src/main/java/org/kie/kogito/examples/PublishRestService.java index ec96c03802..0a229e216d 100644 --- a/serverless-workflow-examples/serverless-workflow-error-quarkus/src/main/java/org/kie/kogito/examples/PublishRestService.java +++ b/serverless-workflow-examples/serverless-workflow-error-quarkus/src/main/java/org/kie/kogito/examples/PublishRestService.java @@ -15,6 +15,7 @@ */ package org.kie.kogito.examples; +import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.annotation.PostConstruct; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; @@ -23,12 +24,9 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response.Status; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.ObjectMapper; - @Path("/publish") @Produces(MediaType.APPLICATION_JSON) public class PublishRestService { diff --git a/serverless-workflow-examples/serverless-workflow-error-quarkus/src/test/java/org/kie/kogito/examples/ErrorRestIT.java b/serverless-workflow-examples/serverless-workflow-error-quarkus/src/test/java/org/kie/kogito/examples/ErrorRestIT.java index 6fec4c0dc6..74c1a75148 100644 --- a/serverless-workflow-examples/serverless-workflow-error-quarkus/src/test/java/org/kie/kogito/examples/ErrorRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-error-quarkus/src/test/java/org/kie/kogito/examples/ErrorRestIT.java @@ -18,13 +18,12 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest public class ErrorRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/ApplicantResource.java b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/ApplicantResource.java index 243e1597f6..a132c59e3f 100644 --- a/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/ApplicantResource.java +++ b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/ApplicantResource.java @@ -18,10 +18,9 @@ */ package org.kogito.serverless.examples; -import java.io.IOException; -import java.net.URI; -import java.util.UUID; - +import com.fasterxml.jackson.databind.JsonNode; +import io.cloudevents.core.builder.CloudEventBuilder; +import jakarta.annotation.PostConstruct; import jakarta.inject.Inject; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.InternalServerErrorException; @@ -29,8 +28,9 @@ import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; - -import jakarta.annotation.PostConstruct; +import java.io.IOException; +import java.net.URI; +import java.util.UUID; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Emitter; import org.kie.kogito.event.CloudEventMarshaller; @@ -39,10 +39,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.JsonNode; - -import io.cloudevents.core.builder.CloudEventBuilder; - @Path("/newapplicant") public class ApplicantResource { diff --git a/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/AvroMarshallerProducer.java b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/AvroMarshallerProducer.java index 5d17e81903..6803919057 100644 --- a/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/AvroMarshallerProducer.java +++ b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/AvroMarshallerProducer.java @@ -18,13 +18,11 @@ */ package org.kogito.serverless.examples; -import java.io.IOException; - +import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.inject.Produces; import jakarta.inject.Named; - -import jakarta.annotation.PostConstruct; +import java.io.IOException; import org.kie.kogito.addon.quarkus.messaging.common.ChannelFormat; import org.kie.kogito.event.CloudEventUnmarshallerFactory; import org.kie.kogito.event.avro.AvroCloudEventUnmarshallerFactory; @@ -52,4 +50,4 @@ AvroIO getAvroIO() { return avroIO; } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/DecisionResource.java b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/DecisionResource.java index b8c565d311..98848b6b25 100644 --- a/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/DecisionResource.java +++ b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/DecisionResource.java @@ -18,18 +18,16 @@ */ package org.kogito.serverless.examples; +import com.fasterxml.jackson.databind.JsonNode; import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; - import org.eclipse.microprofile.reactive.messaging.Channel; import org.jboss.resteasy.annotations.SseElementType; import org.reactivestreams.Publisher; -import com.fasterxml.jackson.databind.JsonNode; - @Path("/decisions") public class DecisionResource { diff --git a/serverless-workflow-examples/serverless-workflow-events-quarkus/src/test/java/org/kogito/serverless/examples/ApplicantWorkflowIT.java b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/test/java/org/kogito/serverless/examples/ApplicantWorkflowIT.java index 75a8da44ee..37ee087ff1 100644 --- a/serverless-workflow-examples/serverless-workflow-events-quarkus/src/test/java/org/kogito/serverless/examples/ApplicantWorkflowIT.java +++ b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/test/java/org/kogito/serverless/examples/ApplicantWorkflowIT.java @@ -23,19 +23,22 @@ import static org.awaitility.Awaitility.await; import static org.junit.jupiter.api.Assertions.assertEquals; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.sse.SseEventSource; import java.net.URI; import java.time.OffsetDateTime; import java.util.List; import java.util.UUID; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.TimeUnit; - -import jakarta.ws.rs.client.Client; -import jakarta.ws.rs.client.ClientBuilder; -import jakarta.ws.rs.client.WebTarget; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.sse.SseEventSource; - import org.apache.kafka.common.serialization.ByteArrayDeserializer; import org.apache.kafka.common.serialization.ByteArraySerializer; import org.eclipse.microprofile.config.ConfigProvider; @@ -47,13 +50,6 @@ import org.kie.kogito.test.quarkus.kafka.KafkaTypedTestClient; import org.kie.kogito.testcontainers.quarkus.KafkaQuarkusTestResource; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.core.builder.CloudEventBuilder; -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusIntegrationTest; - @QuarkusIntegrationTest @QuarkusTestResource(KafkaQuarkusTestResource.class) public class ApplicantWorkflowIT { diff --git a/serverless-workflow-examples/serverless-workflow-expression-quarkus/src/test/java/org/kie/kogito/examples/ExpressionRestIT.java b/serverless-workflow-examples/serverless-workflow-expression-quarkus/src/test/java/org/kie/kogito/examples/ExpressionRestIT.java index 1a1b5152d2..70fe04c8c4 100644 --- a/serverless-workflow-examples/serverless-workflow-expression-quarkus/src/test/java/org/kie/kogito/examples/ExpressionRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-expression-quarkus/src/test/java/org/kie/kogito/examples/ExpressionRestIT.java @@ -18,15 +18,14 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class ExpressionRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/test/java/org/kie/kogito/examples/ForEachRestIT.java b/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/test/java/org/kie/kogito/examples/ForEachRestIT.java index 8b8b06e115..28b810a34d 100644 --- a/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/test/java/org/kie/kogito/examples/ForEachRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-foreach-quarkus/src/test/java/org/kie/kogito/examples/ForEachRestIT.java @@ -18,17 +18,15 @@ */ package org.kie.kogito.examples; -import java.util.Arrays; - -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import java.util.Arrays; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class ForEachRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Appointment.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Appointment.java index 7dc96b31e3..6409b156ef 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Appointment.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Appointment.java @@ -18,11 +18,10 @@ */ package org.acme.sw.onboarding.model; -import java.time.LocalDateTime; -import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonInclude; +import java.time.LocalDateTime; +import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_NULL) public class Appointment { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Doctor.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Doctor.java index 2f0b4a71fe..1d6fbee75d 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Doctor.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Doctor.java @@ -18,9 +18,8 @@ */ package org.acme.sw.onboarding.model; -import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonInclude; +import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_NULL) public class Doctor { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Patient.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Patient.java index a844fc1e74..3d42fa6001 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Patient.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/Patient.java @@ -18,15 +18,14 @@ */ package org.acme.sw.onboarding.model; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class Patient { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/SymptomSpecialty.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/SymptomSpecialty.java index 2bdecf123e..3b4fc006da 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/SymptomSpecialty.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/model/SymptomSpecialty.java @@ -18,11 +18,10 @@ */ package org.acme.sw.onboarding.model; +import com.fasterxml.jackson.annotation.JsonInclude; import java.util.List; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonInclude; - @JsonInclude(JsonInclude.Include.NON_NULL) public class SymptomSpecialty { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/queries/AssignmentUnit.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/queries/AssignmentUnit.java index 4491be6b25..de42890893 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/queries/AssignmentUnit.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/queries/AssignmentUnit.java @@ -18,8 +18,10 @@ */ package org.acme.sw.onboarding.queries; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import java.util.List; - import org.acme.sw.onboarding.model.Doctor; import org.acme.sw.onboarding.model.Patient; import org.acme.sw.onboarding.model.SymptomSpecialty; @@ -29,10 +31,6 @@ import org.drools.ruleunits.api.DataStore; import org.drools.ruleunits.api.RuleUnitData; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public class AssignmentUnit implements RuleUnitData { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/AppointmentResource.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/AppointmentResource.java index b805fe09f3..5e59f45e42 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/AppointmentResource.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/AppointmentResource.java @@ -18,11 +18,6 @@ */ package org.acme.sw.onboarding.resources; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - import jakarta.inject.Inject; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; @@ -34,7 +29,10 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; import org.acme.sw.onboarding.model.Appointment; import org.acme.sw.onboarding.model.Error; import org.acme.sw.onboarding.model.Patient; diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/PatientResource.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/PatientResource.java index d29a5fb9f9..55b7aa031d 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/PatientResource.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/PatientResource.java @@ -18,11 +18,6 @@ */ package org.acme.sw.onboarding.resources; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.UUID; - import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.Consumes; @@ -33,7 +28,10 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.UUID; import org.acme.sw.onboarding.model.Patient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/DoctorService.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/DoctorService.java index 3fafaa6c22..ada48acfde 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/DoctorService.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/DoctorService.java @@ -18,17 +18,15 @@ */ package org.acme.sw.onboarding.services; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.util.ArrayList; import java.util.List; - import org.acme.sw.onboarding.model.Doctor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; - public class DoctorService { private static final String DOCTOR_DATA_PATH = "/data/doctors.json"; diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/ScheduleService.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/ScheduleService.java index 25ebc48c8c..748dfb4107 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/ScheduleService.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/ScheduleService.java @@ -18,6 +18,7 @@ */ package org.acme.sw.onboarding.services; +import jakarta.enterprise.context.ApplicationScoped; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Comparator; @@ -25,9 +26,6 @@ import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; - -import jakarta.enterprise.context.ApplicationScoped; - import org.acme.sw.onboarding.model.Appointment; import org.acme.sw.onboarding.model.Patient; diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/SymptomSpecialtyService.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/SymptomSpecialtyService.java index 5a98db30f9..48cd64f0d3 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/SymptomSpecialtyService.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/services/SymptomSpecialtyService.java @@ -18,17 +18,15 @@ */ package org.acme.sw.onboarding.services; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.util.ArrayList; import java.util.List; - import org.acme.sw.onboarding.model.SymptomSpecialty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; - public class SymptomSpecialtyService { private static final String SYMPTOMS_DATA_PATH = "/data/symptom_specialty.json"; diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/queries/AssignmentUnitIT.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/queries/AssignmentUnitIT.java index 4ba44996ed..58227bb488 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/queries/AssignmentUnitIT.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/queries/AssignmentUnitIT.java @@ -18,15 +18,14 @@ */ package org.acme.sw.onboarding.queries; -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class AssignmentUnitIT { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/queries/AssignmentUnitPlainTest.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/queries/AssignmentUnitPlainTest.java index 8d3016da5f..ca511bf8c0 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/queries/AssignmentUnitPlainTest.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/queries/AssignmentUnitPlainTest.java @@ -18,13 +18,12 @@ */ package org.acme.sw.onboarding.queries; -import java.util.ArrayList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.util.ArrayList; import org.acme.sw.onboarding.model.Doctor; -import org.junit.jupiter.api.Test; import org.drools.ruleunits.api.DataObserver; - -import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; class AssignmentUnitPlainTest { @@ -36,4 +35,4 @@ public void create() { assertEquals(doctors.size(), 6); } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/AppointmentResourceIT.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/AppointmentResourceIT.java index 29f1d06d29..44b36d5ca6 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/AppointmentResourceIT.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/AppointmentResourceIT.java @@ -18,23 +18,20 @@ */ package org.acme.sw.onboarding.resources; +import static io.restassured.RestAssured.given; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.*; + +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.path.json.JsonPath; +import io.restassured.response.ValidatableResponse; +import jakarta.ws.rs.core.MediaType; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; - -import jakarta.ws.rs.core.MediaType; - import org.junit.jupiter.api.Test; -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.path.json.JsonPath; -import io.restassured.response.ValidatableResponse; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; - @QuarkusIntegrationTest class AppointmentResourceIT { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/OnboardingIT.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/OnboardingIT.java index 0f37350d07..4e63997223 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/OnboardingIT.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/OnboardingIT.java @@ -18,22 +18,19 @@ */ package org.acme.sw.onboarding.resources; -import java.time.Duration; -import java.util.UUID; - -import jakarta.ws.rs.core.MediaType; - -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static java.lang.String.format; import static org.awaitility.Awaitility.await; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import jakarta.ws.rs.core.MediaType; +import java.time.Duration; +import java.util.UUID; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class OnboardingIT { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/PatientResourceIT.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/PatientResourceIT.java index d3f2205992..81cabac24d 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/PatientResourceIT.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/resources/PatientResourceIT.java @@ -18,15 +18,14 @@ */ package org.acme.sw.onboarding.resources; -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.not; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class PatientResourceIT { diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/services/ScheduleServiceTest.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/services/ScheduleServiceTest.java index 8e3bc68102..87a6145374 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/services/ScheduleServiceTest.java +++ b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/test/java/org/acme/sw/onboarding/services/ScheduleServiceTest.java @@ -18,22 +18,19 @@ */ package org.acme.sw.onboarding.services; -import java.time.LocalDateTime; -import java.util.List; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; - +import java.time.LocalDateTime; +import java.util.List; import org.acme.sw.onboarding.model.Appointment; import org.acme.sw.onboarding.model.Doctor; import org.acme.sw.onboarding.model.Patient; import org.junit.jupiter.api.Test; -import io.quarkus.test.junit.QuarkusTest; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - @QuarkusTest class ScheduleServiceTest { diff --git a/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/main/java/org/acme/numbers/NumbersResource.java b/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/main/java/org/acme/numbers/NumbersResource.java index 94b4b4fbae..85336bd930 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/main/java/org/acme/numbers/NumbersResource.java +++ b/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/main/java/org/acme/numbers/NumbersResource.java @@ -18,10 +18,8 @@ */ package org.acme.numbers; +import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.annotation.PostConstruct; -import java.util.Random; -import java.util.stream.Collectors; - import jakarta.enterprise.context.ApplicationScoped; import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.GET; @@ -32,12 +30,11 @@ import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - +import java.util.Random; +import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.ObjectMapper; - @Path("/numbers") @Produces(MediaType.APPLICATION_JSON) @ApplicationScoped diff --git a/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/test/java/org/acme/numbers/serverless/workflow/functions/RestExampleIT.java b/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/test/java/org/acme/numbers/serverless/workflow/functions/RestExampleIT.java index 8385cfd5cc..08f380fde5 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/test/java/org/acme/numbers/serverless/workflow/functions/RestExampleIT.java +++ b/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/test/java/org/acme/numbers/serverless/workflow/functions/RestExampleIT.java @@ -18,18 +18,16 @@ */ package org.acme.numbers.serverless.workflow.functions; -import java.util.Collections; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.Matchers.emptyOrNullString; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.Matchers.emptyOrNullString; +import java.util.Collections; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest class RestExampleIT { diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/ClassificationFunction.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/ClassificationFunction.java index 231d817956..96793145e0 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/ClassificationFunction.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/ClassificationFunction.java @@ -18,14 +18,12 @@ */ package org.kogito.serverless.examples.functions; +import io.quarkus.funqy.Funq; import jakarta.inject.Inject; - import org.kogito.serverless.examples.input.Country; import org.kogito.serverless.examples.services.ClassificationService; import org.kogito.serverless.examples.services.CountriesService; -import io.quarkus.funqy.Funq; - public class ClassificationFunction { @Inject CountriesService countriesService; diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/CountriesFunction.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/CountriesFunction.java index 7552fc92c4..7a5ac9a9fd 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/CountriesFunction.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/CountriesFunction.java @@ -18,13 +18,11 @@ */ package org.kogito.serverless.examples.functions; +import io.quarkus.funqy.Funq; import jakarta.inject.Inject; - import org.kogito.serverless.examples.input.Country; import org.kogito.serverless.examples.services.CountriesService; -import io.quarkus.funqy.Funq; - public class CountriesFunction { @Inject CountriesService countriesService; diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/PopulationFunction.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/PopulationFunction.java index 6040e4e9bf..2c6a6d0bed 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/PopulationFunction.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/PopulationFunction.java @@ -18,14 +18,12 @@ */ package org.kogito.serverless.examples.functions; +import io.quarkus.funqy.Funq; import jakarta.inject.Inject; - import org.kogito.serverless.examples.input.Country; import org.kogito.serverless.examples.services.CountriesService; import org.kogito.serverless.examples.services.PopulationService; -import io.quarkus.funqy.Funq; - public class PopulationFunction { @Inject CountriesService countriesService; diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/ClassificationService.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/ClassificationService.java index a92fd12b35..13fbae3169 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/ClassificationService.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/ClassificationService.java @@ -18,11 +18,9 @@ */ package org.kogito.serverless.examples.services; +import jakarta.enterprise.context.ApplicationScoped; import java.util.HashMap; import java.util.Map; - -import jakarta.enterprise.context.ApplicationScoped; - import org.kogito.serverless.examples.input.Country; @ApplicationScoped diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/CountriesService.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/CountriesService.java index bc569785a9..9b94d4ce70 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/CountriesService.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/CountriesService.java @@ -18,11 +18,9 @@ */ package org.kogito.serverless.examples.services; +import jakarta.enterprise.context.ApplicationScoped; import java.util.ArrayList; import java.util.List; - -import jakarta.enterprise.context.ApplicationScoped; - import org.kogito.serverless.examples.input.Country; @ApplicationScoped diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/PopulationService.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/PopulationService.java index 688851d860..c27581c1ab 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/PopulationService.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/PopulationService.java @@ -18,11 +18,9 @@ */ package org.kogito.serverless.examples.services; +import jakarta.enterprise.context.ApplicationScoped; import java.util.HashMap; import java.util.Map; - -import jakarta.enterprise.context.ApplicationScoped; - import org.kogito.serverless.examples.input.Country; @ApplicationScoped diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/test/java/org/kogito/serverless/examples/FunctionsIT.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/test/java/org/kogito/serverless/examples/FunctionsIT.java index 9b2adf8776..c9a41a6cd2 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/test/java/org/kogito/serverless/examples/FunctionsIT.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/test/java/org/kogito/serverless/examples/FunctionsIT.java @@ -18,15 +18,13 @@ */ package org.kogito.serverless.examples; -import org.hamcrest.CoreMatchers; -import org.junit.jupiter.api.Test; -import org.kogito.serverless.examples.input.Country; +import static io.restassured.RestAssured.given; import com.fasterxml.jackson.databind.ObjectMapper; - import io.quarkus.test.junit.QuarkusTest; - -import static io.restassured.RestAssured.given; +import org.hamcrest.CoreMatchers; +import org.junit.jupiter.api.Test; +import org.kogito.serverless.examples.input.Country; @QuarkusTest public class FunctionsIT { diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/src/test/java/org/kogito/serverless/examples/RestServiceMockServer.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/src/test/java/org/kogito/serverless/examples/RestServiceMockServer.java index a3d5916eae..e6fbbc060c 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/src/test/java/org/kogito/serverless/examples/RestServiceMockServer.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/src/test/java/org/kogito/serverless/examples/RestServiceMockServer.java @@ -18,17 +18,15 @@ */ package org.kogito.serverless.examples; -import java.util.Collections; -import java.util.Map; +import static com.github.tomakehurst.wiremock.client.WireMock.*; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.*; +import java.util.Collections; +import java.util.Map; public class RestServiceMockServer implements QuarkusTestResourceLifecycleManager { diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/src/test/java/org/kogito/serverless/examples/WorkflowIT.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/src/test/java/org/kogito/serverless/examples/WorkflowIT.java index 0a9c485e3a..af02285eae 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/src/test/java/org/kogito/serverless/examples/WorkflowIT.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/src/test/java/org/kogito/serverless/examples/WorkflowIT.java @@ -18,13 +18,12 @@ */ package org.kogito.serverless.examples; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest @QuarkusTestResource(RestServiceMockServer.class) diff --git a/serverless-workflow-examples/serverless-workflow-greeting-quarkus/src/test/java/org/kie/kogito/examples/GreetRestIT.java b/serverless-workflow-examples/serverless-workflow-greeting-quarkus/src/test/java/org/kie/kogito/examples/GreetRestIT.java index 8c1bd39191..8930e5c7d1 100644 --- a/serverless-workflow-examples/serverless-workflow-greeting-quarkus/src/test/java/org/kie/kogito/examples/GreetRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-greeting-quarkus/src/test/java/org/kie/kogito/examples/GreetRestIT.java @@ -18,13 +18,12 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.containsString; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.containsString; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest class GreetRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-client-rpc-quarkus/src/test/java/org/kie/kogito/examples/GreetRestIT.java b/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-client-rpc-quarkus/src/test/java/org/kie/kogito/examples/GreetRestIT.java index a9b58ce5fb..f59863fe6b 100644 --- a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-client-rpc-quarkus/src/test/java/org/kie/kogito/examples/GreetRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-client-rpc-quarkus/src/test/java/org/kie/kogito/examples/GreetRestIT.java @@ -18,19 +18,6 @@ */ package org.kie.kogito.examples; -import java.io.IOException; - -import org.eclipse.microprofile.config.ConfigProvider; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.kie.kogito.examples.sw.greeting.GreeterService; - -import io.grpc.Server; -import io.restassured.RestAssured; -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.containsString; @@ -39,6 +26,17 @@ import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasSize; +import io.grpc.Server; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.RestAssured; +import io.restassured.http.ContentType; +import java.io.IOException; +import org.eclipse.microprofile.config.ConfigProvider; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.kie.kogito.examples.sw.greeting.GreeterService; + @QuarkusIntegrationTest class GreetRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/src/main/java/org/kie/kogito/examples/sw/greeting/GreeterService.java b/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/src/main/java/org/kie/kogito/examples/sw/greeting/GreeterService.java index be9d2613f4..8fc2b0a9c9 100644 --- a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/src/main/java/org/kie/kogito/examples/sw/greeting/GreeterService.java +++ b/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/src/main/java/org/kie/kogito/examples/sw/greeting/GreeterService.java @@ -18,18 +18,16 @@ */ package org.kie.kogito.examples.sw.greeting; +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; import java.io.IOException; import java.util.ArrayList; import java.util.List; - import org.kie.kogito.examples.sw.greeting.Greeting.HelloReply; import org.kie.kogito.examples.sw.greeting.Greeting.HelloRequest; -import io.grpc.Server; -import io.grpc.ServerBuilder; -import io.grpc.Status; -import io.grpc.stub.StreamObserver; - public class GreeterService extends GreeterGrpc.GreeterImplBase { public static final String[] SUPPORTED_LANGUAGES = { "English", "Spanish" }; diff --git a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/src/test/java/org/kie/kogito/examples/sw/greeting/GreeterClientTest.java b/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/src/test/java/org/kie/kogito/examples/sw/greeting/GreeterClientTest.java index f6ca922bb1..ddfd7468e5 100644 --- a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/src/test/java/org/kie/kogito/examples/sw/greeting/GreeterClientTest.java +++ b/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/src/test/java/org/kie/kogito/examples/sw/greeting/GreeterClientTest.java @@ -18,6 +18,14 @@ */ package org.kie.kogito.examples.sw.greeting; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Server; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; @@ -25,7 +33,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; - import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -33,15 +40,6 @@ import org.kie.kogito.examples.sw.greeting.Greeting.HelloRequest; import org.kie.kogito.examples.sw.greeting.Greeting.HelloRequest.Builder; -import io.grpc.ManagedChannel; -import io.grpc.ManagedChannelBuilder; -import io.grpc.Server; -import io.grpc.Status; -import io.grpc.stub.StreamObserver; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; - public class GreeterClientTest { private static final int port = Integer.getInteger("grpc.port", 50053); diff --git a/serverless-workflow-examples/serverless-workflow-hello-world/src/test/java/org/kie/kogito/examples/HelloWorldTest.java b/serverless-workflow-examples/serverless-workflow-hello-world/src/test/java/org/kie/kogito/examples/HelloWorldTest.java index 29b63899ef..b776cf1d51 100644 --- a/serverless-workflow-examples/serverless-workflow-hello-world/src/test/java/org/kie/kogito/examples/HelloWorldTest.java +++ b/serverless-workflow-examples/serverless-workflow-hello-world/src/test/java/org/kie/kogito/examples/HelloWorldTest.java @@ -18,15 +18,15 @@ */ package org.kie.kogito.examples; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; + import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; - @QuarkusTest class HelloWorldTest { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventDataFormat.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventDataFormat.java index 1d43db8cf3..37aa2175cf 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventDataFormat.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventDataFormat.java @@ -18,20 +18,16 @@ */ package org.acme.serverless.loanbroker.aggregator; -import java.io.InputStream; -import java.io.OutputStream; - -import jakarta.inject.Inject; -import jakarta.inject.Singleton; - -import org.apache.camel.Exchange; -import org.apache.camel.spi.DataFormat; - import com.fasterxml.jackson.databind.ObjectMapper; - import io.cloudevents.CloudEvent; import io.cloudevents.core.provider.EventFormatProvider; import io.cloudevents.jackson.JsonFormat; +import jakarta.inject.Inject; +import jakarta.inject.Singleton; +import java.io.InputStream; +import java.io.OutputStream; +import org.apache.camel.Exchange; +import org.apache.camel.spi.DataFormat; @Singleton public class CloudEventDataFormat implements DataFormat { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventsConverter.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventsConverter.java index 68345a8c94..bdaf3418f6 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventsConverter.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventsConverter.java @@ -18,25 +18,21 @@ */ package org.acme.serverless.loanbroker.aggregator; -import java.net.URI; -import java.util.UUID; +import static org.acme.serverless.loanbroker.aggregator.IntegrationConstants.KOGITO_FLOW_ID_HEADER; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.CloudEvent; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.core.data.PojoCloudEventData; import jakarta.inject.Inject; import jakarta.inject.Singleton; import jakarta.ws.rs.core.MediaType; - +import java.net.URI; +import java.util.UUID; import org.apache.camel.Exchange; import org.apache.camel.TypeConversionException; import org.apache.camel.support.TypeConverterSupport; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.CloudEvent; -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.core.data.PojoCloudEventData; - -import static org.acme.serverless.loanbroker.aggregator.IntegrationConstants.KOGITO_FLOW_ID_HEADER; - @Singleton public class CloudEventsConverter extends TypeConverterSupport { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/InMemoryQuotesRepositoryProcessor.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/InMemoryQuotesRepositoryProcessor.java index 7c9dcbec67..7c7cba4c40 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/InMemoryQuotesRepositoryProcessor.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/InMemoryQuotesRepositoryProcessor.java @@ -18,13 +18,11 @@ */ package org.acme.serverless.loanbroker.aggregator; +import jakarta.enterprise.context.ApplicationScoped; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; - -import jakarta.enterprise.context.ApplicationScoped; - import org.acme.serverless.loanbroker.aggregator.model.BankQuote; import org.apache.camel.Exchange; import org.slf4j.Logger; diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregationStrategy.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregationStrategy.java index da03c9764f..6af209bdd5 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregationStrategy.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregationStrategy.java @@ -20,7 +20,6 @@ import java.util.ArrayList; import java.util.List; - import org.acme.serverless.loanbroker.aggregator.model.BankQuote; import org.apache.camel.AggregationStrategy; import org.apache.camel.Exchange; diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRoute.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRoute.java index 14ca293698..6340e13fcc 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRoute.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRoute.java @@ -18,16 +18,14 @@ */ package org.acme.serverless.loanbroker.aggregator; +import io.cloudevents.CloudEvent; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; - import org.acme.serverless.loanbroker.aggregator.model.AggregationResponse; import org.apache.camel.Exchange; import org.apache.camel.builder.endpoint.EndpointRouteBuilder; import org.eclipse.microprofile.config.inject.ConfigProperty; -import io.cloudevents.CloudEvent; - /** * Aggregation Strategy for all quotes received. * The payload must be a reference to the BankQuote model and the header must diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesRepositoryProcessor.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesRepositoryProcessor.java index e9993e3cc4..3b3d645a5c 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesRepositoryProcessor.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesRepositoryProcessor.java @@ -19,7 +19,6 @@ package org.acme.serverless.loanbroker.aggregator; import java.util.List; - import org.acme.serverless.loanbroker.aggregator.model.BankQuote; import org.apache.camel.Processor; diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/model/AggregationResponse.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/model/AggregationResponse.java index 07a1440185..a28bd6a9a7 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/model/AggregationResponse.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/model/AggregationResponse.java @@ -20,7 +20,6 @@ import java.io.Serializable; import java.time.LocalDateTime; - import org.acme.serverless.loanbroker.aggregator.IntegrationConstants; import org.acme.serverless.loanbroker.aggregator.QuotesAggregationStrategy; import org.apache.camel.Exchange; diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/model/BankQuote.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/model/BankQuote.java index c89b4c460b..a22104dfbc 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/model/BankQuote.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/model/BankQuote.java @@ -18,11 +18,10 @@ */ package org.acme.serverless.loanbroker.aggregator.model; +import io.quarkus.runtime.annotations.RegisterForReflection; import java.io.Serializable; import java.util.Objects; -import io.quarkus.runtime.annotations.RegisterForReflection; - @RegisterForReflection public class BankQuote implements Serializable { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/QuotesCloudEventsResource.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/QuotesCloudEventsResource.java index e92427e6a8..01088cb406 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/QuotesCloudEventsResource.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/QuotesCloudEventsResource.java @@ -18,6 +18,9 @@ */ package org.acme.serverless.loanbroker.aggregator.resources; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.CloudEvent; +import io.cloudevents.jackson.PojoCloudEventDataMapper; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.POST; @@ -25,7 +28,6 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - import org.acme.serverless.loanbroker.aggregator.IntegrationConstants; import org.acme.serverless.loanbroker.aggregator.model.BankQuote; import org.apache.camel.Produce; @@ -33,11 +35,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.CloudEvent; -import io.cloudevents.jackson.PojoCloudEventDataMapper; - @Path("/") @ApplicationScoped public class QuotesCloudEventsResource { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/QuotesResource.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/QuotesResource.java index 164f4aae4b..6a4871bdc5 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/QuotesResource.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/QuotesResource.java @@ -18,8 +18,6 @@ */ package org.acme.serverless.loanbroker.aggregator.resources; -import java.util.List; - import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.GET; @@ -28,7 +26,7 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - +import java.util.List; import org.acme.serverless.loanbroker.aggregator.QuotesRepositoryProcessor; import org.acme.serverless.loanbroker.aggregator.model.BankQuote; import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/ResponseError.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/ResponseError.java index 0501c2b833..3e7ba40fef 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/ResponseError.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/resources/ResponseError.java @@ -18,11 +18,10 @@ */ package org.acme.serverless.loanbroker.aggregator.resources; -import java.io.Serializable; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; +import java.io.Serializable; @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/test/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRouteTest.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/test/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRouteTest.java index f492f73019..db9e25d967 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/test/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRouteTest.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/test/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRouteTest.java @@ -18,22 +18,16 @@ */ package org.acme.serverless.loanbroker.aggregator; -import java.net.URI; -import java.util.concurrent.TimeUnit; - -import jakarta.inject.Inject; -import jakarta.ws.rs.core.MediaType; - -import org.acme.serverless.loanbroker.aggregator.model.BankQuote; -import org.apache.camel.Exchange; -import org.hamcrest.core.Is; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; +import static com.github.tomakehurst.wiremock.client.WireMock.containing; +import static com.github.tomakehurst.wiremock.client.WireMock.equalTo; +import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import static org.acme.serverless.loanbroker.aggregator.IntegrationConstants.KOGITO_FLOW_ID_HEADER; +import static org.testcontainers.shaded.org.awaitility.Awaitility.await; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.github.tomakehurst.wiremock.WireMockServer; - import io.cloudevents.CloudEvent; import io.cloudevents.core.builder.CloudEventBuilder; import io.cloudevents.core.data.PojoCloudEventData; @@ -42,13 +36,15 @@ import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; - -import static com.github.tomakehurst.wiremock.client.WireMock.containing; -import static com.github.tomakehurst.wiremock.client.WireMock.equalTo; -import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.acme.serverless.loanbroker.aggregator.IntegrationConstants.KOGITO_FLOW_ID_HEADER; -import static org.testcontainers.shaded.org.awaitility.Awaitility.await; +import jakarta.inject.Inject; +import jakarta.ws.rs.core.MediaType; +import java.net.URI; +import java.util.concurrent.TimeUnit; +import org.acme.serverless.loanbroker.aggregator.model.BankQuote; +import org.apache.camel.Exchange; +import org.hamcrest.core.Is; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; @QuarkusTest @QuarkusTestResource(SinkMockTestResource.class) diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/test/java/org/acme/serverless/loanbroker/aggregator/SinkMockTestResource.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/test/java/org/acme/serverless/loanbroker/aggregator/SinkMockTestResource.java index 26e205801c..702f451be8 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/test/java/org/acme/serverless/loanbroker/aggregator/SinkMockTestResource.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/test/java/org/acme/serverless/loanbroker/aggregator/SinkMockTestResource.java @@ -18,18 +18,16 @@ */ package org.acme.serverless.loanbroker.aggregator; -import java.util.HashMap; -import java.util.Map; - -import com.github.tomakehurst.wiremock.WireMockServer; - -import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; +import com.github.tomakehurst.wiremock.WireMockServer; +import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; +import java.util.HashMap; +import java.util.Map; + public class SinkMockTestResource implements QuarkusTestResourceLifecycleManager { private WireMockServer server; diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/CreditBureauMock.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/CreditBureauMock.java index 43a6d1a8d3..d7e0a36c19 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/CreditBureauMock.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/CreditBureauMock.java @@ -18,19 +18,16 @@ */ package org.acme.serverless.loanbroker.flow; -import java.util.Collections; -import java.util.Map; - -import jakarta.ws.rs.core.MediaType; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching; +import jakarta.ws.rs.core.MediaType; +import java.util.Collections; +import java.util.Map; public class CreditBureauMock implements QuarkusTestResourceLifecycleManager { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/LoanBrokerFlowTest.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/LoanBrokerFlowTest.java index eb88db575f..9baa29dc38 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/LoanBrokerFlowTest.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/LoanBrokerFlowTest.java @@ -18,21 +18,17 @@ */ package org.acme.serverless.loanbroker.flow; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -import jakarta.ws.rs.core.MediaType; - -import org.junit.jupiter.api.Test; +import static com.github.tomakehurst.wiremock.client.WireMock.containing; +import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.testcontainers.shaded.org.awaitility.Awaitility.await; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.github.tomakehurst.wiremock.WireMockServer; - import io.cloudevents.CloudEvent; import io.cloudevents.core.builder.CloudEventBuilder; import io.cloudevents.core.provider.EventFormatProvider; @@ -41,13 +37,13 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; - -import static com.github.tomakehurst.wiremock.client.WireMock.containing; -import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static java.util.concurrent.TimeUnit.SECONDS; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.testcontainers.shaded.org.awaitility.Awaitility.await; +import jakarta.ws.rs.core.MediaType; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; +import org.junit.jupiter.api.Test; @QuarkusTest @QuarkusTestResource(SinkMock.class) diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/QuotesAggregatorMock.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/QuotesAggregatorMock.java index 60da745410..6139d6057f 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/QuotesAggregatorMock.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/QuotesAggregatorMock.java @@ -18,19 +18,16 @@ */ package org.acme.serverless.loanbroker.flow; -import java.util.Collections; -import java.util.Map; - -import jakarta.ws.rs.core.MediaType; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching; +import jakarta.ws.rs.core.MediaType; +import java.util.Collections; +import java.util.Map; /** * Mocks the aggregator service that must return a list of quotes diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/SinkMock.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/SinkMock.java index 95a8281b08..51076dccd6 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/SinkMock.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/java/org/acme/serverless/loanbroker/flow/SinkMock.java @@ -18,16 +18,14 @@ */ package org.acme.serverless.loanbroker.flow; -import java.util.Collections; -import java.util.Map; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.post; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.post; +import java.util.Collections; +import java.util.Map; /** * Mocks the Knative Sink service. Every event produced by the workflow will be diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/AppResource.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/AppResource.java index 248309bf4a..cd3a0ce246 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/AppResource.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/AppResource.java @@ -18,8 +18,10 @@ */ package org.acme.loanbroker; -import java.util.Map; - +import io.cloudevents.CloudEvent; +import io.quarkus.qute.CheckedTemplate; +import io.quarkus.qute.TemplateInstance; +import io.vertx.mutiny.core.eventbus.EventBus; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.GET; @@ -28,17 +30,12 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - +import java.util.Map; import org.acme.loanbroker.domain.QuotesResponse; import org.eclipse.microprofile.config.inject.ConfigProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.cloudevents.CloudEvent; -import io.quarkus.qute.CheckedTemplate; -import io.quarkus.qute.TemplateInstance; -import io.vertx.mutiny.core.eventbus.EventBus; - @Path("/") @ApplicationScoped public class AppResource { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/NewQuoteSocket.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/NewQuoteSocket.java index e46a39a6c8..e08547335a 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/NewQuoteSocket.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/NewQuoteSocket.java @@ -18,24 +18,20 @@ */ package org.acme.loanbroker; -import java.util.Queue; -import java.util.concurrent.ConcurrentLinkedQueue; - +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.quarkus.vertx.ConsumeEvent; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.websocket.OnOpen; import jakarta.websocket.Session; import jakarta.websocket.server.ServerEndpoint; - +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; import org.acme.loanbroker.domain.QuotesResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.quarkus.vertx.ConsumeEvent; - @ServerEndpoint("/socket/quote/new") @ApplicationScoped public class NewQuoteSocket { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/QuotesRepository.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/QuotesRepository.java index 350ec9d531..bb56891863 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/QuotesRepository.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/QuotesRepository.java @@ -18,20 +18,16 @@ */ package org.acme.loanbroker; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.CloudEvent; +import io.cloudevents.jackson.PojoCloudEventDataMapper; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - import org.acme.loanbroker.domain.QuotesResponse; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.CloudEvent; -import io.cloudevents.jackson.PojoCloudEventDataMapper; - @ApplicationScoped public class QuotesRepository { @Inject diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/domain/Credit.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/domain/Credit.java index 1d93685b11..d7971b2282 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/domain/Credit.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/domain/Credit.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; - import java.util.Objects; public class Credit { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/domain/QuotesResponse.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/domain/QuotesResponse.java index 286d6f98cd..81a255476a 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/domain/QuotesResponse.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/java/org/acme/loanbroker/domain/QuotesResponse.java @@ -18,13 +18,12 @@ */ package org.acme.loanbroker.domain; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - @JsonIgnoreProperties(ignoreUnknown = true) public class QuotesResponse implements Serializable { diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/test/java/org/acme/loanbroker/AppResourceTest.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/test/java/org/acme/loanbroker/AppResourceTest.java index 5148a78e27..866bebbe03 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/test/java/org/acme/loanbroker/AppResourceTest.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/test/java/org/acme/loanbroker/AppResourceTest.java @@ -18,13 +18,17 @@ */ package org.acme.loanbroker; -import java.io.IOException; -import java.net.URI; -import java.util.Collections; -import java.util.Objects; -import java.util.concurrent.LinkedBlockingDeque; -import java.util.concurrent.TimeUnit; +import static io.restassured.RestAssured.given; +import static org.junit.jupiter.api.Assertions.assertEquals; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.CloudEvent; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.core.data.PojoCloudEventData; +import io.cloudevents.core.provider.EventFormatProvider; +import io.cloudevents.jackson.JsonFormat; +import io.quarkus.test.common.http.TestHTTPResource; +import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; import jakarta.websocket.ClientEndpoint; import jakarta.websocket.ContainerProvider; @@ -32,25 +36,17 @@ import jakarta.websocket.OnMessage; import jakarta.websocket.Session; import jakarta.ws.rs.core.MediaType; - +import java.io.IOException; +import java.net.URI; +import java.util.Collections; +import java.util.Objects; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; import org.acme.loanbroker.domain.Credit; import org.acme.loanbroker.domain.Quote; import org.acme.loanbroker.domain.QuotesResponse; import org.junit.jupiter.api.Test; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.CloudEvent; -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.core.data.PojoCloudEventData; -import io.cloudevents.core.provider.EventFormatProvider; -import io.cloudevents.jackson.JsonFormat; -import io.quarkus.test.common.http.TestHTTPResource; -import io.quarkus.test.junit.QuarkusTest; - -import static io.restassured.RestAssured.given; -import static org.junit.jupiter.api.Assertions.assertEquals; - @QuarkusTest public class AppResourceTest { diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/main/java/org/kie/kogito/examples/VertxRouter.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/main/java/org/kie/kogito/examples/VertxRouter.java index d3cc018eeb..f8ed908c51 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/main/java/org/kie/kogito/examples/VertxRouter.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/main/java/org/kie/kogito/examples/VertxRouter.java @@ -18,11 +18,10 @@ */ package org.kie.kogito.examples; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; - import io.vertx.core.http.HttpMethod; import io.vertx.ext.web.Router; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Observes; @ApplicationScoped public class VertxRouter { diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SinkMock.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SinkMock.java index cc41fef517..9b9dfcd525 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SinkMock.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SinkMock.java @@ -18,16 +18,14 @@ */ package org.acme.newsletter.subscription.flow; -import java.util.Collections; -import java.util.Map; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.post; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.post; +import java.util.Collections; +import java.util.Map; // Mocking our Knative broker, the new.subscriber event should be broadcast to it public class SinkMock implements QuarkusTestResourceLifecycleManager { diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SubscriptionFlowIT.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SubscriptionFlowIT.java index 0dd0b79406..405cd796cc 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SubscriptionFlowIT.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SubscriptionFlowIT.java @@ -18,10 +18,15 @@ */ package org.acme.newsletter.subscription.flow; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; +import static com.github.tomakehurst.wiremock.client.WireMock.containing; +import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import static io.restassured.RestAssured.given; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.acme.newsletter.subscription.flow.SubscriptionConstants.EMAIL; +import static org.acme.newsletter.subscription.flow.SubscriptionConstants.NAME; +import static org.assertj.core.api.Assertions.assertThat; +import static org.awaitility.Awaitility.await; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; @@ -34,18 +39,12 @@ import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; import org.junit.jupiter.api.Test; -import static com.github.tomakehurst.wiremock.client.WireMock.containing; -import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static io.restassured.RestAssured.given; -import static java.util.concurrent.TimeUnit.SECONDS; -import static org.acme.newsletter.subscription.flow.SubscriptionConstants.EMAIL; -import static org.acme.newsletter.subscription.flow.SubscriptionConstants.NAME; -import static org.assertj.core.api.Assertions.assertThat; -import static org.awaitility.Awaitility.await; - @QuarkusIntegrationTest @QuarkusTestResource(SubscriptionServiceMock.class) @QuarkusTestResource(SinkMock.class) diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SubscriptionServiceMock.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SubscriptionServiceMock.java index 4eae27ce90..446ee49f49 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SubscriptionServiceMock.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/test/java/org/acme/newsletter/subscription/flow/SubscriptionServiceMock.java @@ -18,21 +18,6 @@ */ package org.acme.newsletter.subscription.flow; -import java.util.Collections; -import java.util.Map; - -import org.acme.newsletter.subscription.service.Subscription; -import org.acme.newsletter.subscription.service.SubscriptionResource; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.tomakehurst.wiremock.WireMockServer; -import com.github.tomakehurst.wiremock.core.WireMockConfiguration; -import com.github.tomakehurst.wiremock.matching.EqualToPattern; -import com.github.tomakehurst.wiremock.matching.UrlPathPattern; - -import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.get; import static com.github.tomakehurst.wiremock.client.WireMock.post; @@ -42,6 +27,18 @@ import static org.acme.newsletter.subscription.flow.SubscriptionConstants.EMAIL; import static org.acme.newsletter.subscription.flow.SubscriptionConstants.newSubscription; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.core.WireMockConfiguration; +import com.github.tomakehurst.wiremock.matching.EqualToPattern; +import com.github.tomakehurst.wiremock.matching.UrlPathPattern; +import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; +import java.util.Collections; +import java.util.Map; +import org.acme.newsletter.subscription.service.Subscription; +import org.acme.newsletter.subscription.service.SubscriptionResource; + public class SubscriptionServiceMock implements QuarkusTestResourceLifecycleManager { private WireMockServer wireMockServer; diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/InMemorySubscriptionRepository.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/InMemorySubscriptionRepository.java index c22cd7e765..887a8259cb 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/InMemorySubscriptionRepository.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/InMemorySubscriptionRepository.java @@ -18,20 +18,17 @@ */ package org.acme.newsletter.subscription.service; +import io.quarkus.arc.DefaultBean; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; - -import jakarta.enterprise.context.ApplicationScoped; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.quarkus.arc.DefaultBean; -import jakarta.annotation.PostConstruct; - /** * This default implementation is used when the persistence is not enabled. */ diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/PostgreSqlSubscriptionRepository.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/PostgreSqlSubscriptionRepository.java index 06917d4dba..3ec7a3fd89 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/PostgreSqlSubscriptionRepository.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/PostgreSqlSubscriptionRepository.java @@ -18,17 +18,7 @@ */ package org.acme.newsletter.subscription.service; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import static java.util.stream.Collectors.toList; import io.quarkus.arc.properties.IfBuildProperty; import io.quarkus.runtime.Startup; @@ -37,8 +27,15 @@ import io.vertx.mutiny.sqlclient.RowSet; import io.vertx.mutiny.sqlclient.Tuple; import jakarta.annotation.PostConstruct; - -import static java.util.stream.Collectors.toList; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @ApplicationScoped @Startup diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/Subscription.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/Subscription.java index 9dd9932eda..55efa8fae1 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/Subscription.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/Subscription.java @@ -18,12 +18,11 @@ */ package org.acme.newsletter.subscription.service; -import java.io.Serializable; -import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import java.util.Objects; @JsonIgnoreProperties(ignoreUnknown = true) public class Subscription implements Serializable { diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/SubscriptionResource.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/SubscriptionResource.java index 6a5fbb3a0d..05162d027f 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/SubscriptionResource.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/SubscriptionResource.java @@ -18,9 +18,10 @@ */ package org.acme.newsletter.subscription.service; -import java.io.Serializable; -import java.util.Optional; - +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.quarkus.runtime.annotations.RegisterForReflection; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.Consumes; @@ -34,18 +35,13 @@ import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - +import java.io.Serializable; +import java.util.Optional; import org.eclipse.microprofile.openapi.annotations.media.Content; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; import org.eclipse.microprofile.openapi.annotations.responses.APIResponseSchema; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import io.quarkus.runtime.annotations.RegisterForReflection; - @ApplicationScoped @Path("/subscription") @RegisterForReflection diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/SubscriptionServiceImpl.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/SubscriptionServiceImpl.java index 7372b87d37..688091c215 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/SubscriptionServiceImpl.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/main/java/org/acme/newsletter/subscription/service/SubscriptionServiceImpl.java @@ -18,11 +18,10 @@ */ package org.acme.newsletter.subscription.service; -import java.util.List; -import java.util.Optional; - import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; +import java.util.List; +import java.util.Optional; @ApplicationScoped public class SubscriptionServiceImpl implements SubscriptionService { diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/test/java/org/acme/newsletter/subscription/service/SubscriptionResourceIT.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/test/java/org/acme/newsletter/subscription/service/SubscriptionResourceIT.java index 2b13337d4b..1233d94538 100644 --- a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/test/java/org/acme/newsletter/subscription/service/SubscriptionResourceIT.java +++ b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-service/src/test/java/org/acme/newsletter/subscription/service/SubscriptionResourceIT.java @@ -18,18 +18,15 @@ */ package org.acme.newsletter.subscription.service; -import java.util.UUID; - -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.assertj.core.api.Assertions.assertThat; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; - import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.assertj.core.api.Assertions.assertThat; +import java.util.UUID; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest public class SubscriptionResourceIT { @@ -117,4 +114,4 @@ void verifySubscriptionCycle() throws JsonProcessingException { assertThat(aSubscription.isVerified()).isTrue(); } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/AcmeFinancialResource.java b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/AcmeFinancialResource.java index 9dee457775..176a51533b 100644 --- a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/AcmeFinancialResource.java +++ b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/AcmeFinancialResource.java @@ -18,20 +18,18 @@ */ package org.acme; +import io.quarkus.security.identity.SecurityIdentity; import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.MediaType; - import org.eclipse.microprofile.openapi.annotations.Operation; import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.quarkus.security.identity.SecurityIdentity; - @Path("financial-service") public class AcmeFinancialResource { diff --git a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/ExchangeRatesDB.java b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/ExchangeRatesDB.java index a54f583483..d73f20ae51 100644 --- a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/ExchangeRatesDB.java +++ b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/ExchangeRatesDB.java @@ -18,13 +18,11 @@ */ package org.acme; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; import java.util.HashMap; import java.util.Map; -import jakarta.enterprise.context.ApplicationScoped; - -import jakarta.annotation.PostConstruct; - /** * Emulates the Acme Financial Services database, implementation and maintenance of this DB * is out of the scope of this example. diff --git a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/test/java/org/acme/AcmeExchangeResourceIT.java b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/test/java/org/acme/AcmeExchangeResourceIT.java index 80f396a421..d2c85b6ae8 100644 --- a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/test/java/org/acme/AcmeExchangeResourceIT.java +++ b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/test/java/org/acme/AcmeExchangeResourceIT.java @@ -18,20 +18,18 @@ */ package org.acme; -import java.util.stream.Stream; +import static io.restassured.RestAssured.given; +import static org.assertj.core.api.Assertions.assertThat; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.quarkus.test.keycloak.client.KeycloakTestClient; +import io.restassured.http.ContentType; +import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.quarkus.test.keycloak.client.KeycloakTestClient; -import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.assertj.core.api.Assertions.assertThat; - @QuarkusIntegrationTest class AcmeExchangeResourceIT { diff --git a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/currency-exchange-workflow/src/main/java/org/kie/kogito/examples/ExchangeWorkflowHelper.java b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/currency-exchange-workflow/src/main/java/org/kie/kogito/examples/ExchangeWorkflowHelper.java index 0a46100bef..4a3d248a03 100644 --- a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/currency-exchange-workflow/src/main/java/org/kie/kogito/examples/ExchangeWorkflowHelper.java +++ b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/currency-exchange-workflow/src/main/java/org/kie/kogito/examples/ExchangeWorkflowHelper.java @@ -18,14 +18,12 @@ */ package org.kie.kogito.examples; +import jakarta.enterprise.context.ApplicationScoped; import java.time.LocalDate; import java.time.format.DateTimeParseException; import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; - -import jakarta.enterprise.context.ApplicationScoped; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/serverless-workflow-examples/serverless-workflow-order-processing/src/test/java/org/kie/kogito/examples/sw/orders/processing/VerifyWorkflowExecutionIT.java b/serverless-workflow-examples/serverless-workflow-order-processing/src/test/java/org/kie/kogito/examples/sw/orders/processing/VerifyWorkflowExecutionIT.java index 85af1b21ed..0c5ec7b257 100644 --- a/serverless-workflow-examples/serverless-workflow-order-processing/src/test/java/org/kie/kogito/examples/sw/orders/processing/VerifyWorkflowExecutionIT.java +++ b/serverless-workflow-examples/serverless-workflow-order-processing/src/test/java/org/kie/kogito/examples/sw/orders/processing/VerifyWorkflowExecutionIT.java @@ -18,21 +18,6 @@ */ package org.kie.kogito.examples.sw.orders.processing; -import java.util.UUID; - -import jakarta.ws.rs.core.MediaType; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.tomakehurst.wiremock.WireMockServer; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.RestAssured; - import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.containing; import static com.github.tomakehurst.wiremock.client.WireMock.post; @@ -43,6 +28,17 @@ import static java.util.concurrent.TimeUnit.SECONDS; import static org.awaitility.Awaitility.await; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.tomakehurst.wiremock.WireMockServer; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.RestAssured; +import jakarta.ws.rs.core.MediaType; +import java.util.UUID; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest public class VerifyWorkflowExecutionIT { diff --git a/serverless-workflow-examples/serverless-workflow-parallel-execution/src/test/java/org/kie/kogito/examples/ParallelStateTest.java b/serverless-workflow-examples/serverless-workflow-parallel-execution/src/test/java/org/kie/kogito/examples/ParallelStateTest.java index bf64f05da5..f6e1afacac 100644 --- a/serverless-workflow-examples/serverless-workflow-parallel-execution/src/test/java/org/kie/kogito/examples/ParallelStateTest.java +++ b/serverless-workflow-examples/serverless-workflow-parallel-execution/src/test/java/org/kie/kogito/examples/ParallelStateTest.java @@ -18,13 +18,12 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.hasLength; import io.quarkus.test.junit.QuarkusTest; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.Matchers.hasLength; +import org.junit.jupiter.api.Test; @QuarkusTest class ParallelStateTest { diff --git a/serverless-workflow-examples/serverless-workflow-python-quarkus/src/test/java/org/kie/kogito/examples/PythonRestIT.java b/serverless-workflow-examples/serverless-workflow-python-quarkus/src/test/java/org/kie/kogito/examples/PythonRestIT.java index 7f428fe5b5..d90ee64294 100644 --- a/serverless-workflow-examples/serverless-workflow-python-quarkus/src/test/java/org/kie/kogito/examples/PythonRestIT.java +++ b/serverless-workflow-examples/serverless-workflow-python-quarkus/src/test/java/org/kie/kogito/examples/PythonRestIT.java @@ -18,16 +18,13 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.assertj.core.api.Assertions.assertThat; import com.fasterxml.jackson.databind.JsonNode; - import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.assertj.core.api.Assertions.assertThat; - +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest public class PythonRestIT { diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/InMemoryQueryRecordRepository.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/InMemoryQueryRecordRepository.java index ed0cd4b7d2..20f7e7e774 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/InMemoryQueryRecordRepository.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/InMemoryQueryRecordRepository.java @@ -18,18 +18,16 @@ */ package org.acme; +import io.quarkus.arc.DefaultBean; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.quarkus.arc.DefaultBean; - /** * This default implementation is used when the persistence is not enabled. */ diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/PostgreSqlQueryRecordRepository.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/PostgreSqlQueryRecordRepository.java index d534e149c7..90516e91e5 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/PostgreSqlQueryRecordRepository.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/PostgreSqlQueryRecordRepository.java @@ -18,6 +18,11 @@ */ package org.acme; +import io.quarkus.arc.properties.IfBuildProperty; +import io.quarkus.runtime.Startup; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -27,17 +32,10 @@ import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; import javax.sql.DataSource; -import jakarta.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.quarkus.arc.properties.IfBuildProperty; -import io.quarkus.runtime.Startup; - /** * This PostgreSqlQueryRecordRepository implementation is used when the application is build with the persistence profile. */ diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/QueryAnswerServiceHelper.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/QueryAnswerServiceHelper.java index 708164fe7c..fb8d62949a 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/QueryAnswerServiceHelper.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/QueryAnswerServiceHelper.java @@ -18,21 +18,18 @@ */ package org.acme; -import java.time.ZonedDateTime; +import static org.acme.QueryRecord.ERROR; +import static org.acme.QueryRecord.PENDING; +import static org.acme.QueryRecord.RESOLVED; +import com.fasterxml.jackson.databind.JsonNode; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; - +import java.time.ZonedDateTime; import org.kie.kogito.internal.process.runtime.KogitoProcessContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.JsonNode; - -import static org.acme.QueryRecord.ERROR; -import static org.acme.QueryRecord.PENDING; -import static org.acme.QueryRecord.RESOLVED; - /** * Helper class used from the SW workflow actions to update the queries and answers being constructed. */ diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/QueryAnswerServiceResource.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/QueryAnswerServiceResource.java index 1d53d2fb5c..ce39510dbe 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/QueryAnswerServiceResource.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/main/java/org/acme/QueryAnswerServiceResource.java @@ -18,12 +18,11 @@ */ package org.acme; -import java.util.List; - import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; +import java.util.List; @Path("/queries") @ApplicationScoped diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/test/java/org/acme/it/QueryAnswerServiceIT.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/test/java/org/acme/it/QueryAnswerServiceIT.java index 91a9e978b0..ffab99f4e4 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/test/java/org/acme/it/QueryAnswerServiceIT.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/test/java/org/acme/it/QueryAnswerServiceIT.java @@ -18,11 +18,24 @@ */ package org.acme.it; +import static io.restassured.RestAssured.given; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.assertj.core.api.Assertions.assertThat; +import static org.awaitility.Awaitility.await; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.jackson.JsonCloudEventData; +import io.cloudevents.jackson.JsonFormat; +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import io.restassured.path.json.JsonPath; import java.net.URI; import java.time.OffsetDateTime; import java.util.List; import java.util.UUID; - import org.acme.QueryRecord; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -31,22 +44,6 @@ import org.kie.kogito.test.quarkus.kafka.KafkaTestClient; import org.kie.kogito.testcontainers.quarkus.KafkaQuarkusTestResource; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; - -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.jackson.JsonCloudEventData; -import io.cloudevents.jackson.JsonFormat; -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; -import io.restassured.path.json.JsonPath; - -import static io.restassured.RestAssured.given; -import static java.util.concurrent.TimeUnit.SECONDS; -import static org.assertj.core.api.Assertions.assertThat; -import static org.awaitility.Awaitility.await; - @QuarkusIntegrationTest @QuarkusTestResource(WireMockQueryServiceResource.class) @QuarkusTestResource(KafkaQuarkusTestResource.class) diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/test/java/org/acme/it/WireMockQueryServiceResource.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/test/java/org/acme/it/WireMockQueryServiceResource.java index a6c80dce23..e12c980ed1 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/test/java/org/acme/it/WireMockQueryServiceResource.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/src/test/java/org/acme/it/WireMockQueryServiceResource.java @@ -18,13 +18,6 @@ */ package org.acme.it; -import java.util.HashMap; -import java.util.Map; - -import com.github.tomakehurst.wiremock.WireMockServer; - -import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.configureFor; import static com.github.tomakehurst.wiremock.client.WireMock.post; @@ -32,6 +25,11 @@ import static jakarta.ws.rs.core.HttpHeaders.CONTENT_TYPE; import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; +import com.github.tomakehurst.wiremock.WireMockServer; +import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; +import java.util.HashMap; +import java.util.Map; + public class WireMockQueryServiceResource implements QuarkusTestResourceLifecycleManager { public static final String QUERY_SERVICE_URL = "query-service-url"; diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/CloudEventsCustomizer.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/CloudEventsCustomizer.java index b161f0d909..201157f3a2 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/CloudEventsCustomizer.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/CloudEventsCustomizer.java @@ -18,12 +18,10 @@ */ package org.acme; -import jakarta.inject.Singleton; - import com.fasterxml.jackson.databind.ObjectMapper; - import io.cloudevents.jackson.JsonFormat; import io.quarkus.jackson.ObjectMapperCustomizer; +import jakarta.inject.Singleton; /** * Ensure the registration of the CloudEvent jackson module according to the Quarkus suggested procedure. diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/InMemoryQueryRequestRepository.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/InMemoryQueryRequestRepository.java index d8db70f3cc..854ce1fae6 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/InMemoryQueryRequestRepository.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/InMemoryQueryRequestRepository.java @@ -18,19 +18,16 @@ */ package org.acme; +import io.quarkus.arc.DefaultBean; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; - -import jakarta.enterprise.context.ApplicationScoped; - -import jakarta.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.quarkus.arc.DefaultBean; - /** * This default implementation is used when the persistence is not enabled. */ diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/PostgreSqlQueryRequestRepository.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/PostgreSqlQueryRequestRepository.java index 3e2541e968..bc9983b963 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/PostgreSqlQueryRequestRepository.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/PostgreSqlQueryRequestRepository.java @@ -18,15 +18,7 @@ */ package org.acme; -import java.util.List; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.annotation.PostConstruct; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import static java.util.stream.Collectors.toList; import io.quarkus.arc.properties.IfBuildProperty; import io.quarkus.runtime.Startup; @@ -34,8 +26,14 @@ import io.vertx.mutiny.sqlclient.RowIterator; import io.vertx.mutiny.sqlclient.RowSet; import io.vertx.mutiny.sqlclient.Tuple; - -import static java.util.stream.Collectors.toList; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import java.util.List; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This PostgreSqlQueryRequestRepository implementation is used when the application is built with the persistence profile. diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/QueryServiceResource.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/QueryServiceResource.java index 9fa7a40567..33df40ab87 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/QueryServiceResource.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/main/java/org/acme/QueryServiceResource.java @@ -18,11 +18,11 @@ */ package org.acme; -import java.net.URI; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.UUID; - +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.jackson.JsonCloudEventData; +import io.quarkus.reactivemessaging.http.runtime.OutgoingHttpMetadata; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.Consumes; @@ -32,20 +32,16 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Emitter; import org.eclipse.microprofile.reactive.messaging.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.jackson.JsonCloudEventData; -import io.quarkus.reactivemessaging.http.runtime.OutgoingHttpMetadata; - @Path("query-service") @ApplicationScoped public class QueryServiceResource { @@ -106,4 +102,4 @@ public String generateCloudEvent(String processInstanceId, String queryResponse) throw new IllegalArgumentException(e); } } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/test/java/org/acme/it/QueryServiceResourceIT.java b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/test/java/org/acme/it/QueryServiceResourceIT.java index 8590bf6785..2e853faf40 100644 --- a/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/test/java/org/acme/it/QueryServiceResourceIT.java +++ b/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/src/test/java/org/acme/it/QueryServiceResourceIT.java @@ -18,17 +18,15 @@ */ package org.acme.it; -import java.util.List; - -import org.acme.QueryRequest; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.assertj.core.api.Assertions.assertThat; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.http.ContentType; import io.restassured.path.json.JsonPath; - -import static io.restassured.RestAssured.given; -import static org.assertj.core.api.Assertions.assertThat; +import java.util.List; +import org.acme.QueryRequest; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest class QueryServiceResourceIT { @@ -93,4 +91,4 @@ private List getCurrentRequests() { .jsonPath(); return currentRequests.getList("", QueryRequest.class); } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/MockService.java b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/MockService.java index 448ffd0175..dd735b012e 100644 --- a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/MockService.java +++ b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/MockService.java @@ -18,12 +18,10 @@ */ package org.kie.kogito.examples; +import jakarta.enterprise.context.ApplicationScoped; import java.util.Objects; import java.util.Optional; import java.util.UUID; - -import jakarta.enterprise.context.ApplicationScoped; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/OrderService.java b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/OrderService.java index 055c1d9c50..51f9b05205 100644 --- a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/OrderService.java +++ b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/OrderService.java @@ -19,7 +19,6 @@ package org.kie.kogito.examples; import jakarta.enterprise.context.ApplicationScoped; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/PaymentService.java b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/PaymentService.java index 478828eb42..e209e9bbd2 100644 --- a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/PaymentService.java +++ b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/PaymentService.java @@ -20,7 +20,6 @@ import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/ShippingService.java b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/ShippingService.java index 599256315d..919ed95fa3 100644 --- a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/ShippingService.java +++ b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/ShippingService.java @@ -20,7 +20,6 @@ import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/StockService.java b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/StockService.java index e798f64ff8..e926b8b6ca 100644 --- a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/StockService.java +++ b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/main/java/org/kie/kogito/examples/StockService.java @@ -20,7 +20,6 @@ import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/test/java/org/kie/kogito/examples/OrderSagaWorkflowIT.java b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/test/java/org/kie/kogito/examples/OrderSagaWorkflowIT.java index 2fe543d9a8..fdbcdfb29a 100644 --- a/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/test/java/org/kie/kogito/examples/OrderSagaWorkflowIT.java +++ b/serverless-workflow-examples/serverless-workflow-saga-quarkus/src/test/java/org/kie/kogito/examples/OrderSagaWorkflowIT.java @@ -18,15 +18,14 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.notNullValue; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.http.ContentType; import io.restassured.response.ValidatableResponse; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.notNullValue; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest public class OrderSagaWorkflowIT { diff --git a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/CountriesClassifierResource.java b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/CountriesClassifierResource.java index 3c4b2766a0..fb4c849bd3 100644 --- a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/CountriesClassifierResource.java +++ b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/CountriesClassifierResource.java @@ -18,21 +18,18 @@ */ package org.kogito.serverless.examples; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Set; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; - +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Set; import org.jboss.logging.Logger; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - @Path("/countryclassifier") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) diff --git a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/Country.java b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/Country.java index a2ffe2cda0..338547691a 100644 --- a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/Country.java +++ b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/Country.java @@ -18,9 +18,8 @@ */ package org.kogito.serverless.examples; -import java.util.List; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class Country { diff --git a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/CountryServiceWorkflowTest.java b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/CountryServiceWorkflowTest.java index 65bcaa562d..b972d04356 100644 --- a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/CountryServiceWorkflowTest.java +++ b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/CountryServiceWorkflowTest.java @@ -18,26 +18,22 @@ */ package org.kogito.serverless.examples; -import java.util.HashMap; -import java.util.Map; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; import jakarta.inject.Named; - +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.kie.kogito.Model; import org.kie.kogito.process.Process; import org.kie.kogito.process.ProcessInstance; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - @QuarkusTest @QuarkusTestResource(RestCountriesMockServer.class) public class CountryServiceWorkflowTest { diff --git a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/RestCountriesMockServer.java b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/RestCountriesMockServer.java index ec2c6f40b8..a6a58c6c54 100644 --- a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/RestCountriesMockServer.java +++ b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/RestCountriesMockServer.java @@ -18,20 +18,18 @@ */ package org.kogito.serverless.examples; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; public class RestCountriesMockServer implements QuarkusTestResourceLifecycleManager { diff --git a/serverless-workflow-examples/serverless-workflow-stock-profit/stock-portfolio-service/src/test/java/org/acme/ProfitResourceTest.java b/serverless-workflow-examples/serverless-workflow-stock-profit/stock-portfolio-service/src/test/java/org/acme/ProfitResourceTest.java index b805e52496..4bbb133ff0 100644 --- a/serverless-workflow-examples/serverless-workflow-stock-profit/stock-portfolio-service/src/test/java/org/acme/ProfitResourceTest.java +++ b/serverless-workflow-examples/serverless-workflow-stock-profit/stock-portfolio-service/src/test/java/org/acme/ProfitResourceTest.java @@ -18,11 +18,10 @@ */ package org.acme; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; import java.math.BigDecimal; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; class ProfitResourceTest { @@ -31,4 +30,4 @@ void calculateProfit() { BigDecimal profit = ProfitResource.calculateProfit(new BigDecimal("12.56"), new BigDecimal("10.00")); assertEquals(new BigDecimal("0.26"), profit); } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-stock-profit/stock-profit/src/test/java/org/acme/MockServices.java b/serverless-workflow-examples/serverless-workflow-stock-profit/stock-profit/src/test/java/org/acme/MockServices.java index f89bb94fd3..fb5e8a70a0 100644 --- a/serverless-workflow-examples/serverless-workflow-stock-profit/stock-profit/src/test/java/org/acme/MockServices.java +++ b/serverless-workflow-examples/serverless-workflow-stock-profit/stock-profit/src/test/java/org/acme/MockServices.java @@ -18,17 +18,16 @@ */ package org.acme; -import com.github.tomakehurst.wiremock.WireMockServer; -import com.github.tomakehurst.wiremock.core.WireMockConfiguration; -import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import java.util.Map; - import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.get; import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.core.WireMockConfiguration; +import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; +import java.util.Map; + public class MockServices implements QuarkusTestResourceLifecycleManager { private WireMockServer wireMockServer; diff --git a/serverless-workflow-examples/serverless-workflow-stock-profit/stock-profit/src/test/java/org/acme/StockProfitIT.java b/serverless-workflow-examples/serverless-workflow-stock-profit/stock-profit/src/test/java/org/acme/StockProfitIT.java index 8cc76d9701..c0c0032fb9 100644 --- a/serverless-workflow-examples/serverless-workflow-stock-profit/stock-profit/src/test/java/org/acme/StockProfitIT.java +++ b/serverless-workflow-examples/serverless-workflow-stock-profit/stock-profit/src/test/java/org/acme/StockProfitIT.java @@ -18,19 +18,18 @@ */ package org.acme; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; + import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; +import java.util.Collections; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.util.Collections; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; - @QuarkusIntegrationTest @QuarkusTestResource(MockServices.class) class StockProfitIT { diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-full/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-full/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java index bd3bbe07b1..c01239fb5d 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-full/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-full/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java @@ -18,19 +18,17 @@ */ package org.kie.kogito.serverless; -import java.util.Collections; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; +import java.util.Collections; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest @QuarkusTestResource(OperationsMockService.class) diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-full/src/test/java/org/kie/kogito/serverless/OperationsMockService.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-full/src/test/java/org/kie/kogito/serverless/OperationsMockService.java index f82871273c..e76f362374 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-full/src/test/java/org/kie/kogito/serverless/OperationsMockService.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-full/src/test/java/org/kie/kogito/serverless/OperationsMockService.java @@ -18,19 +18,16 @@ */ package org.kie.kogito.serverless; -import java.util.Collections; -import java.util.Map; - -import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.WireMock; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import java.util.Collections; +import java.util.Map; +import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; public class OperationsMockService implements QuarkusTestResourceLifecycleManager { diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java index bd3bbe07b1..c01239fb5d 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java @@ -18,19 +18,17 @@ */ package org.kie.kogito.serverless; -import java.util.Collections; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; +import java.util.Collections; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest @QuarkusTestResource(OperationsMockService.class) diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/src/test/java/org/kie/kogito/serverless/OperationsMockService.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/src/test/java/org/kie/kogito/serverless/OperationsMockService.java index f82871273c..e76f362374 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/src/test/java/org/kie/kogito/serverless/OperationsMockService.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/src/test/java/org/kie/kogito/serverless/OperationsMockService.java @@ -18,19 +18,16 @@ */ package org.kie.kogito.serverless; -import java.util.Collections; -import java.util.Map; - -import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.WireMock; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import java.util.Collections; +import java.util.Map; +import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; public class OperationsMockService implements QuarkusTestResourceLifecycleManager { diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java index bd3bbe07b1..c01239fb5d 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java @@ -18,19 +18,17 @@ */ package org.kie.kogito.serverless; -import java.util.Collections; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; +import java.util.Collections; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest @QuarkusTestResource(OperationsMockService.class) diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/src/test/java/org/kie/kogito/serverless/OperationsMockService.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/src/test/java/org/kie/kogito/serverless/OperationsMockService.java index f82871273c..e76f362374 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/src/test/java/org/kie/kogito/serverless/OperationsMockService.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/src/test/java/org/kie/kogito/serverless/OperationsMockService.java @@ -18,19 +18,16 @@ */ package org.kie.kogito.serverless; -import java.util.Collections; -import java.util.Map; - -import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.WireMock; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import java.util.Collections; +import java.util.Map; +import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; public class OperationsMockService implements QuarkusTestResourceLifecycleManager { diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java index bd3bbe07b1..c01239fb5d 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/src/test/java/org/kie/kogito/serverless/ConversationFlowIT.java @@ -18,19 +18,17 @@ */ package org.kie.kogito.serverless; -import java.util.Collections; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; +import java.util.Collections; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest @QuarkusTestResource(OperationsMockService.class) diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/src/test/java/org/kie/kogito/serverless/OperationsMockService.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/src/test/java/org/kie/kogito/serverless/OperationsMockService.java index 1feeb37869..6ca014ad44 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/src/test/java/org/kie/kogito/serverless/OperationsMockService.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/src/test/java/org/kie/kogito/serverless/OperationsMockService.java @@ -18,19 +18,16 @@ */ package org.kie.kogito.serverless; -import java.util.Collections; -import java.util.Map; - -import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.WireMock; - import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import java.util.Collections; +import java.util.Map; +import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; public class OperationsMockService implements QuarkusTestResourceLifecycleManager { diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/MultiplicationOperation.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/MultiplicationOperation.java index 422dd826c1..0c10d0b5f1 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/MultiplicationOperation.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/MultiplicationOperation.java @@ -18,9 +18,8 @@ */ package org.kie.kogito.examples.sw.temp.multiplication; -import java.util.Objects; - import io.quarkus.runtime.annotations.RegisterForReflection; +import java.util.Objects; /** * See: Multiplication diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResource.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResource.java index 6ed4b72264..f24cf4c94f 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResource.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResource.java @@ -18,6 +18,7 @@ */ package org.kie.kogito.examples.sw.temp.multiplication; +import io.quarkus.runtime.annotations.RegisterForReflection; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.POST; @@ -25,11 +26,8 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - import org.eclipse.microprofile.openapi.annotations.responses.APIResponseSchema; -import io.quarkus.runtime.annotations.RegisterForReflection; - @Path("/") public class OperationResource { diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/test/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResourceIT.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/test/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResourceIT.java index 0b331059cf..f9bc30b90e 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/test/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResourceIT.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/test/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResourceIT.java @@ -18,15 +18,14 @@ */ package org.kie.kogito.examples.sw.temp.multiplication; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.http.ContentType; import io.restassured.response.Response; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.jupiter.api.Test; @QuarkusIntegrationTest class OperationResourceIT { diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResource.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResource.java index 7648677f01..e13f9cdc7c 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResource.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResource.java @@ -18,6 +18,7 @@ */ package org.kie.kogito.examples.sw.temp.subtraction; +import io.quarkus.runtime.annotations.RegisterForReflection; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.POST; @@ -25,11 +26,8 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - import org.eclipse.microprofile.openapi.annotations.responses.APIResponseSchema; -import io.quarkus.runtime.annotations.RegisterForReflection; - @Path("/") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/SubtractionOperation.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/SubtractionOperation.java index 710e67cc3d..027c291034 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/SubtractionOperation.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/SubtractionOperation.java @@ -18,9 +18,8 @@ */ package org.kie.kogito.examples.sw.temp.subtraction; -import java.util.Objects; - import io.quarkus.runtime.annotations.RegisterForReflection; +import java.util.Objects; /** * See: Subtraction diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/test/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResourceIT.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/test/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResourceIT.java index 9a06b6dc4d..9d65983563 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/test/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResourceIT.java +++ b/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/test/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResourceIT.java @@ -18,15 +18,14 @@ */ package org.kie.kogito.examples.sw.temp.subtraction; -import org.junit.jupiter.api.Test; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.restassured.http.ContentType; - import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.Test; + @QuarkusIntegrationTest class OperationResourceIT { diff --git a/serverless-workflow-examples/serverless-workflow-testing-with-rest-assured/src/test/java/org/kie/kogito/examples/HelloTest.java b/serverless-workflow-examples/serverless-workflow-testing-with-rest-assured/src/test/java/org/kie/kogito/examples/HelloTest.java index 15f1c6a1c8..7c510c3527 100644 --- a/serverless-workflow-examples/serverless-workflow-testing-with-rest-assured/src/test/java/org/kie/kogito/examples/HelloTest.java +++ b/serverless-workflow-examples/serverless-workflow-testing-with-rest-assured/src/test/java/org/kie/kogito/examples/HelloTest.java @@ -18,15 +18,14 @@ */ package org.kie.kogito.examples; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.equalTo; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.Matchers.equalTo; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; @QuarkusTest class HelloTest { diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/EventsProducerResource.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/EventsProducerResource.java index 7611e766aa..f31c658fa8 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/EventsProducerResource.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/EventsProducerResource.java @@ -18,10 +18,11 @@ */ package org.kie.kogito.examples; -import java.net.URI; -import java.time.OffsetDateTime; -import java.util.UUID; - +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.jackson.JsonCloudEventData; +import io.quarkus.reactivemessaging.http.runtime.OutgoingHttpMetadata; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.Consumes; @@ -31,18 +32,13 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.UUID; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Emitter; import org.eclipse.microprofile.reactive.messaging.Message; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.jackson.JsonCloudEventData; -import io.quarkus.reactivemessaging.http.runtime.OutgoingHttpMetadata; - /** * Helper resource with convenient operations to produce events for the serverless workflows that are waiting for * events to arrive. @@ -216,4 +212,4 @@ public void setEventData(String eventData) { this.eventData = eventData; } } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/VertxRouter.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/VertxRouter.java index d3cc018eeb..f8ed908c51 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/VertxRouter.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/VertxRouter.java @@ -18,11 +18,10 @@ */ package org.kie.kogito.examples; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; - import io.vertx.core.http.HttpMethod; import io.vertx.ext.web.Router; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Observes; @ApplicationScoped public class VertxRouter { diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/test/java/org/kie/kogito/examples/TimeoutIT.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/test/java/org/kie/kogito/examples/TimeoutIT.java index edaff888be..b624383605 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/test/java/org/kie/kogito/examples/TimeoutIT.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/test/java/org/kie/kogito/examples/TimeoutIT.java @@ -18,18 +18,17 @@ */ package org.kie.kogito.examples; -import java.util.concurrent.TimeUnit; +import static io.restassured.RestAssured.given; +import static org.awaitility.Awaitility.await; +import static org.hamcrest.Matchers.equalTo; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; +import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static io.restassured.RestAssured.given; -import static org.awaitility.Awaitility.await; -import static org.hamcrest.Matchers.equalTo; - @QuarkusIntegrationTest class TimeoutIT { diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/EventsProducerResource.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/EventsProducerResource.java index ab6046e46e..4a63df8082 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/EventsProducerResource.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/EventsProducerResource.java @@ -18,10 +18,13 @@ */ package org.kie.kogito.examples; -import java.net.URI; -import java.time.OffsetDateTime; -import java.util.UUID; - +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.cloudevents.jackson.JsonCloudEventData; +import io.quarkus.reactivemessaging.http.runtime.OutgoingHttpMetadata; +import io.vertx.core.http.HttpMethod; +import io.vertx.ext.web.Router; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.event.Observes; import jakarta.inject.Inject; @@ -32,20 +35,13 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - -import io.vertx.core.http.HttpMethod; -import io.vertx.ext.web.Router; +import java.net.URI; +import java.time.OffsetDateTime; +import java.util.UUID; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Emitter; import org.eclipse.microprofile.reactive.messaging.Message; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.cloudevents.core.builder.CloudEventBuilder; -import io.cloudevents.jackson.JsonCloudEventData; -import io.quarkus.reactivemessaging.http.runtime.OutgoingHttpMetadata; - /** * Helper resource with convenient operations to produce events for the serverless workflows that are waiting for * events to arrive. @@ -219,4 +215,4 @@ public void setEventData(String eventData) { this.eventData = eventData; } } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/VertxRouter.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/VertxRouter.java index d3cc018eeb..f8ed908c51 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/VertxRouter.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/VertxRouter.java @@ -18,11 +18,10 @@ */ package org.kie.kogito.examples; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; - import io.vertx.core.http.HttpMethod; import io.vertx.ext.web.Router; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Observes; @ApplicationScoped public class VertxRouter { diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/test/java/org/kie/kogito/examples/TimeoutIT.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/test/java/org/kie/kogito/examples/TimeoutIT.java index edaff888be..b624383605 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/test/java/org/kie/kogito/examples/TimeoutIT.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/test/java/org/kie/kogito/examples/TimeoutIT.java @@ -18,18 +18,17 @@ */ package org.kie.kogito.examples; -import java.util.concurrent.TimeUnit; +import static io.restassured.RestAssured.given; +import static org.awaitility.Awaitility.await; +import static org.hamcrest.Matchers.equalTo; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; +import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static io.restassured.RestAssured.given; -import static org.awaitility.Awaitility.await; -import static org.hamcrest.Matchers.equalTo; - @QuarkusIntegrationTest class TimeoutIT { diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CallbackStateTimeoutsClient.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CallbackStateTimeoutsClient.java index 85b416b85b..22f37aa2a3 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CallbackStateTimeoutsClient.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CallbackStateTimeoutsClient.java @@ -18,7 +18,7 @@ */ package org.kie.kogito.examples; -import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import static org.kie.kogito.examples.CallbackStateTimeoutsClient.CONFIG_KEY; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DefaultValue; @@ -31,8 +31,7 @@ import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - -import static org.kie.kogito.examples.CallbackStateTimeoutsClient.CONFIG_KEY; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; @Path("/") @RegisterRestClient(configKey = CONFIG_KEY) diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CloudEventsCustomizer.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CloudEventsCustomizer.java index 5979828a07..a57450d5d6 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CloudEventsCustomizer.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CloudEventsCustomizer.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.cloudevents.jackson.JsonFormat; import io.quarkus.jackson.ObjectMapperCustomizer; - import jakarta.inject.Singleton; /** diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/EventStateTimeoutsClient.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/EventStateTimeoutsClient.java index 57614e9fb3..502c68c850 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/EventStateTimeoutsClient.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/EventStateTimeoutsClient.java @@ -18,7 +18,7 @@ */ package org.kie.kogito.examples; -import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import static org.kie.kogito.examples.EventStateTimeoutsClient.CONFIG_KEY; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DefaultValue; @@ -31,8 +31,7 @@ import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - -import static org.kie.kogito.examples.EventStateTimeoutsClient.CONFIG_KEY; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; @Path("/") @RegisterRestClient(configKey = CONFIG_KEY) diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/EventsProducerResource.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/EventsProducerResource.java index 55d8412535..dc72a89c7d 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/EventsProducerResource.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/EventsProducerResource.java @@ -22,8 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.cloudevents.core.builder.CloudEventBuilder; import io.cloudevents.jackson.JsonCloudEventData; -import org.eclipse.microprofile.rest.client.inject.RestClient; - import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.Consumes; @@ -36,6 +34,7 @@ import java.net.URI; import java.time.OffsetDateTime; import java.util.UUID; +import org.eclipse.microprofile.rest.client.inject.RestClient; /** * Helper resource with convenient operations to produce events for the serverless workflows that are waiting for @@ -224,4 +223,4 @@ public void setEventData(String eventData) { this.eventData = eventData; } } -} \ No newline at end of file +} diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/SwitchStateTimeoutsClient.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/SwitchStateTimeoutsClient.java index b02d854a83..f1d1a147f0 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/SwitchStateTimeoutsClient.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/SwitchStateTimeoutsClient.java @@ -18,7 +18,7 @@ */ package org.kie.kogito.examples; -import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import static org.kie.kogito.examples.SwitchStateTimeoutsClient.CONFIG_KEY; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DefaultValue; @@ -31,8 +31,7 @@ import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - -import static org.kie.kogito.examples.SwitchStateTimeoutsClient.CONFIG_KEY; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; @Path("/") @RegisterRestClient(configKey = CONFIG_KEY) diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/VertxRouter.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/VertxRouter.java index d3cc018eeb..f8ed908c51 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/VertxRouter.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/VertxRouter.java @@ -18,11 +18,10 @@ */ package org.kie.kogito.examples; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; - import io.vertx.core.http.HttpMethod; import io.vertx.ext.web.Router; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Observes; @ApplicationScoped public class VertxRouter { diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowClient.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowClient.java index d4c091ad6e..d74d9d7e05 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowClient.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowClient.java @@ -18,14 +18,13 @@ */ package org.kie.kogito.examples; -import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam; - import jakarta.ws.rs.Consumes; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; +import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam; public interface WorkflowClient { diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowTimeoutsClient.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowTimeoutsClient.java index 70fbcf6fa9..d8451c1cb0 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowTimeoutsClient.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowTimeoutsClient.java @@ -18,7 +18,7 @@ */ package org.kie.kogito.examples; -import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import static org.kie.kogito.examples.WorkflowTimeoutsClient.CONFIG_KEY; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DefaultValue; @@ -31,8 +31,7 @@ import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; - -import static org.kie.kogito.examples.WorkflowTimeoutsClient.CONFIG_KEY; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; @Path("/") @RegisterRestClient(configKey = CONFIG_KEY) diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowsProxyResource.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowsProxyResource.java index 9ef3481841..ae6a3daadb 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowsProxyResource.java +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/WorkflowsProxyResource.java @@ -18,8 +18,6 @@ */ package org.kie.kogito.examples; -import org.eclipse.microprofile.rest.client.inject.RestClient; - import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.ws.rs.Consumes; @@ -33,6 +31,7 @@ import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; +import org.eclipse.microprofile.rest.client.inject.RestClient; /** * The objective of this class is to provide a simple proxy for the invocations from the UI to the SWs, and avoid