Skip to content

Commit

Permalink
Springboot 3 fixes (#3191)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianonicolai committed Aug 29, 2023
1 parent 07a403e commit ae3ff70
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 64 deletions.
57 changes: 57 additions & 0 deletions .ci/environments/quarkus-3/patches/0022_spring_boot_it_fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,60 @@ index 9eed010a53..627c1085c3 100644
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
diff --git a/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/PMMLTreeTest.java b/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/PMMLTreeTest.java
--- a/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/PMMLTreeTest.java (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/PMMLTreeTest.java (date 1693288356561)
@@ -40,7 +40,7 @@
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = KogitoSpringbootApplication.class)
class PMMLTreeTest extends BaseRestTest {

- private static final String BASE_PATH = "/PMMLTree/SampleMine/";
+ private static final String BASE_PATH = "/PMMLTree/SampleMine";
private static final String TARGET = "decision";

static {
diff --git a/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/PMMLRegressionTest.java b/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/PMMLRegressionTest.java
--- a/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/PMMLRegressionTest.java (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/PMMLRegressionTest.java (date 1693288356557)
@@ -43,7 +43,7 @@
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = KogitoSpringbootApplication.class)
class PMMLRegressionTest extends BaseRestTest {

- private static final String BASE_PATH = "/PMMLRegression/LinReg/";
+ private static final String BASE_PATH = "/PMMLRegression/LinReg";
private static final String TARGET = "fld4";

static {
diff --git a/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/CommonPMMLTestUtils.java b/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/CommonPMMLTestUtils.java
--- a/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/CommonPMMLTestUtils.java (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/src/test/java/org/kie/kogito/integrationtests/springboot/CommonPMMLTestUtils.java (date 1693288384011)
@@ -61,7 +61,7 @@
final String basePath,
final String targetField,
final Map<String, Object> expectedResultMap) {
- String path = basePath + "descriptive";
+ String path = basePath + "/descriptive";
final Response response = given()
.contentType(ContentType.JSON)
.body(inputData)
diff --git a/springboot/integration-tests/src/it/integration-tests-springboot-kafka-it/src/test/java/org/kie/kogito/integrationtests/springboot/PingPongMessageTest.java b/springboot/integration-tests/src/it/integration-tests-springboot-kafka-it/src/test/java/org/kie/kogito/integrationtests/springboot/PingPongMessageTest.java
--- a/springboot/integration-tests/src/it/integration-tests-springboot-kafka-it/src/test/java/org/kie/kogito/integrationtests/springboot/PingPongMessageTest.java (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/integration-tests/src/it/integration-tests-springboot-kafka-it/src/test/java/org/kie/kogito/integrationtests/springboot/PingPongMessageTest.java (date 1693286486274)
@@ -82,7 +82,7 @@
.untilAsserted(() -> given()
.contentType(ContentType.JSON)
.when()
- .get("/pong_message/")
+ .get("/pong_message")
.then()
.statusCode(200)
.body("$.size()", equalTo(1)));
@@ -90,7 +90,7 @@
String pId = given()
.contentType(ContentType.JSON)
.when()
- .get("/pong_message/")
+ .get("/pong_message")
.then()
.statusCode(200)
.body("$.size()", equalTo(1))
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
diff --git a/springboot/bom/pom.xml b/springboot/bom/pom.xml
--- a/springboot/bom/pom.xml (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/bom/pom.xml (date 1693298572368)
@@ -16,7 +16,7 @@

<properties>
<version.io.swagger.core.v3>2.2.7</version.io.swagger.core.v3>
- <version.org.springdoc>1.6.14</version.org.springdoc>
+ <version.org.springdoc>2.1.0</version.org.springdoc>
<!-- Groovy -->
<!-- must be aligned with the Archetype plugin: https://maven.apache.org/archetype/maven-archetype-plugin/dependencies.html -->
<version.org.codehaus.groovy>2.4.16</version.org.codehaus.groovy>
@@ -39,7 +39,7 @@
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
- <artifactId>springdoc-openapi-ui</artifactId>
+ <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${version.org.springdoc}</version>
</dependency>
<dependency>
diff --git a/springboot/integration-tests/src/it/integration-tests-springboot-norest-it/pom.xml b/springboot/integration-tests/src/it/integration-tests-springboot-norest-it/pom.xml
--- a/springboot/integration-tests/src/it/integration-tests-springboot-norest-it/pom.xml (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/integration-tests/src/it/integration-tests-springboot-norest-it/pom.xml (date 1693298572352)
@@ -61,7 +61,7 @@

<dependency>
<groupId>org.springdoc</groupId>
- <artifactId>springdoc-openapi-ui</artifactId>
+ <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
<dependency>
<groupId>io.swagger.parser.v3</groupId>
diff --git a/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/pom.xml b/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/pom.xml
--- a/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/pom.xml (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/pom.xml (date 1693298572361)
@@ -95,7 +95,7 @@

<dependency>
<groupId>org.springdoc</groupId>
- <artifactId>springdoc-openapi-ui</artifactId>
+ <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
<dependency>
<groupId>io.swagger.parser.v3</groupId>
diff --git a/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/pom.xml b/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/pom.xml
--- a/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/pom.xml (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/integration-tests/src/it/integration-tests-springboot-decisions-it/pom.xml (date 1693298572365)
@@ -75,7 +75,7 @@

<dependency>
<groupId>org.springdoc</groupId>
- <artifactId>springdoc-openapi-ui</artifactId>
+ <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
<dependency>
<groupId>io.swagger.parser.v3</groupId>
diff --git a/springboot/starters/pom.xml b/springboot/starters/pom.xml
--- a/springboot/starters/pom.xml (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/starters/pom.xml (date 1693298572356)
@@ -57,7 +57,7 @@
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
- <artifactId>springdoc-openapi-ui</artifactId>
+ <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
64 changes: 0 additions & 64 deletions .ci/environments/quarkus-3/patches/0023_springboot_webflux.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/kogito-build/kogito-dependencies-bom/pom.xml b/kogito-build/kogito-dependencies-bom/pom.xml
--- a/kogito-build/kogito-dependencies-bom/pom.xml (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/kogito-build/kogito-dependencies-bom/pom.xml (date 1693299114156)
@@ -505,6 +505,12 @@
<version>${version.com.github.tomakehurst.wiremock}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.github.tomakehurst</groupId>
+ <artifactId>wiremock-jre8-standalone</artifactId>
+ <version>${version.com.github.tomakehurst.wiremock}</version>
+ <scope>test</scope>
+ </dependency>

<dependency>
<groupId>org.apache.maven.shared</groupId>
diff --git a/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/pom.xml b/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/pom.xml
--- a/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/pom.xml (revision 9e11adb52d8ca94fd2f25beebf07cd5925983ac4)
+++ b/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/pom.xml (date 1693298751800)
@@ -89,7 +89,7 @@
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
- <artifactId>wiremock-jre8</artifactId>
+ <artifactId>wiremock-jre8-standalone</artifactId>
<scope>test</scope>
</dependency>

20 changes: 20 additions & 0 deletions .ci/environments/quarkus-3/patches/0025_openapi_codegen_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-deployment/src/main/java/org/kie/kogito/quarkus/serverless/workflow/openapi/WorkflowOpenApiHandlerGenerator.java b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-deployment/src/main/java/org/kie/kogito/quarkus/serverless/workflow/openapi/WorkflowOpenApiHandlerGenerator.java
--- a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-deployment/src/main/java/org/kie/kogito/quarkus/serverless/workflow/openapi/WorkflowOpenApiHandlerGenerator.java (revision eae1492e2f8e90587095c369fe0506ae272ec12a)
+++ b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-deployment/src/main/java/org/kie/kogito/quarkus/serverless/workflow/openapi/WorkflowOpenApiHandlerGenerator.java (date 1693311380768)
@@ -27,6 +27,7 @@
import org.jboss.jandex.DotName;
import org.jboss.jandex.MethodInfo;
import org.jboss.jandex.Type;
+import org.jboss.jandex.VoidType;
import org.kie.kogito.codegen.api.context.KogitoBuildContext;
import org.kie.kogito.quarkus.serverless.workflow.ClassAnnotatedWorkflowHandlerGenerator;
import org.kie.kogito.quarkus.serverless.workflow.WorkflowCodeGenUtils;
@@ -88,7 +89,7 @@
BlockStmt body = executeMethod.createBody();
MethodCallExpr methodCallExpr = new MethodCallExpr(new NameExpr(OPEN_API_REF), m.name());
final NameExpr parameters = new NameExpr(WORK_ITEM_PARAMETERS);
- if (m.returnType().name().equals(DotName.createSimple(Response.class.getName()))) {
+ if (m.returnType().name().equals(DotName.createSimple(Response.class.getName())) || (m.returnType() instanceof VoidType)) {
body.addStatement(methodCallExpr).addStatement(new ReturnStmt(new NullLiteralExpr()));
} else {
body.addStatement(new ReturnStmt(methodCallExpr));

0 comments on commit ae3ff70

Please sign in to comment.