From 121b4b87a403e11325f7962296f023b52f403df3 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Sat, 21 Oct 2023 21:32:01 +0200 Subject: [PATCH 1/2] Bump Quarkus from 2.8 to 3.4 --- .../src/test/resources/pit-quarkus/pom.xml | 48 ++++++++++++++----- .../example/controller/ExampleController.java | 8 ++-- .../com/example/service/ExampleService.java | 2 +- .../com/example/ExampleControllerTest.java | 2 +- .../java/com/example/ExampleServiceTest.java | 2 +- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/pitest-maven-verification/src/test/resources/pit-quarkus/pom.xml b/pitest-maven-verification/src/test/resources/pit-quarkus/pom.xml index 35e23a12e..78c3b37fc 100644 --- a/pitest-maven-verification/src/test/resources/pit-quarkus/pom.xml +++ b/pitest-maven-verification/src/test/resources/pit-quarkus/pom.xml @@ -3,18 +3,17 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.example - pitest-quarlus + pitest-quarkus 1.0.0-SNAPSHOT - 3.8.1 - false + 3.11.0 11 UTF-8 UTF-8 quarkus-bom io.quarkus.platform - 2.8.3.Final - 3.0.0-M5 + 3.4.3 + 3.1.2 1.0.0 @@ -39,14 +38,8 @@ test - io.quarkus - quarkus-junit5 - test - - io.quarkus quarkus-junit5-mockito - 2.8.1.Final test @@ -90,6 +83,25 @@ + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + org.pitest @@ -113,4 +125,18 @@ + + + native + + + native + + + + false + native + + + diff --git a/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/controller/ExampleController.java b/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/controller/ExampleController.java index 88552124c..51b1cf7d4 100644 --- a/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/controller/ExampleController.java +++ b/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/controller/ExampleController.java @@ -2,10 +2,10 @@ import com.example.service.ExampleService; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; @Path("/example") @ApplicationScoped diff --git a/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/service/ExampleService.java b/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/service/ExampleService.java index 7c0a6c76f..681f07856 100644 --- a/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/service/ExampleService.java +++ b/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/service/ExampleService.java @@ -1,7 +1,7 @@ package com.example.service; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; @ApplicationScoped public class ExampleService { diff --git a/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/ExampleControllerTest.java b/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/ExampleControllerTest.java index 61ebefe02..f38a114c4 100644 --- a/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/ExampleControllerTest.java +++ b/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/ExampleControllerTest.java @@ -6,7 +6,7 @@ import org.mockito.Mockito; import com.example.service.ExampleService; -import javax.inject.Inject; +import jakarta.inject.Inject; import io.quarkus.test.junit.mockito.InjectMock; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/ExampleServiceTest.java b/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/ExampleServiceTest.java index 2b02aade9..817eba329 100644 --- a/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/ExampleServiceTest.java +++ b/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/ExampleServiceTest.java @@ -4,7 +4,7 @@ import com.example.service.ExampleService; import org.junit.jupiter.api.Test; -import javax.inject.Inject; +import jakarta.inject.Inject; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; From 59d0ef0bab1e6264c806b75d6f8245eb4384c81d Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Sat, 21 Oct 2023 21:52:25 +0200 Subject: [PATCH 2/2] Add usual Quarkus test from generated application --- .../src/test/resources/pit-quarkus/pom.xml | 5 +++++ .../java/com/example/GreetingResource.java | 16 ++++++++++++++ .../com/example/GreetingResourceTest.java | 21 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/GreetingResource.java create mode 100644 pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/GreetingResourceTest.java diff --git a/pitest-maven-verification/src/test/resources/pit-quarkus/pom.xml b/pitest-maven-verification/src/test/resources/pit-quarkus/pom.xml index 78c3b37fc..b750f4eda 100644 --- a/pitest-maven-verification/src/test/resources/pit-quarkus/pom.xml +++ b/pitest-maven-verification/src/test/resources/pit-quarkus/pom.xml @@ -42,6 +42,11 @@ quarkus-junit5-mockito test + + io.rest-assured + rest-assured + test + io.quarkus quarkus-resteasy-reactive-jackson diff --git a/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/GreetingResource.java b/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/GreetingResource.java new file mode 100644 index 000000000..06eb6a8d7 --- /dev/null +++ b/pitest-maven-verification/src/test/resources/pit-quarkus/src/main/java/com/example/GreetingResource.java @@ -0,0 +1,16 @@ +package com.example; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +@Path("/hello") +public class GreetingResource { + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String hello() { + return "Hello from RESTEasy Reactive"; + } +} diff --git a/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/GreetingResourceTest.java b/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/GreetingResourceTest.java new file mode 100644 index 000000000..1fed6419e --- /dev/null +++ b/pitest-maven-verification/src/test/resources/pit-quarkus/src/test/java/com/example/GreetingResourceTest.java @@ -0,0 +1,21 @@ +package com.example; + +import io.quarkus.test.junit.QuarkusTest; +import org.junit.jupiter.api.Test; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; + +@QuarkusTest +public class GreetingResourceTest { + + @Test + public void testHelloEndpoint() { + given() + .when().get("/hello") + .then() + .statusCode(200) + .body(is("Hello from RESTEasy Reactive")); + } + +} \ No newline at end of file