diff --git a/devtools/gradle-it-run/pom.xml b/devtools/gradle-it-run/pom.xml index 5e20df1bbc2547..293e871999bee0 100644 --- a/devtools/gradle-it-run/pom.xml +++ b/devtools/gradle-it-run/pom.xml @@ -34,6 +34,17 @@ junit-jupiter-engine test + + ch.vorburger.exec + exec + 3.1.1 + test + + + org.slf4j + slf4j-simple + test + io.rest-assured rest-assured diff --git a/devtools/gradle-it-run/src/test/java/io/quarkus/gradle/it/GradleRunIntegrationTest.java b/devtools/gradle-it-run/src/test/java/io/quarkus/gradle/it/GradleRunIntegrationTest.java index 7cdef753d4ad78..9c29c6ad325cc6 100644 --- a/devtools/gradle-it-run/src/test/java/io/quarkus/gradle/it/GradleRunIntegrationTest.java +++ b/devtools/gradle-it-run/src/test/java/io/quarkus/gradle/it/GradleRunIntegrationTest.java @@ -18,10 +18,12 @@ import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; -import java.io.IOException; - import org.junit.jupiter.api.Test; +import ch.vorburger.exec.ManagedProcess; +import ch.vorburger.exec.ManagedProcessBuilder; +import ch.vorburger.exec.ManagedProcessException; + /** * Integration Test which runs the sample app built by Gradle. * @@ -31,11 +33,11 @@ public class GradleRunIntegrationTest { // do not rename this to *IT because we want it to run on regular mvn test without requiring failsafe @Test - public void testHelloEndpoint() throws IOException { - Process process = new ProcessBuilder() - // .directory("../") - .command("java", "-jar", "../gradle-it/build/gradle-it-runner.jar") - .start(); + public void testHelloEndpoint() throws ManagedProcessException { + ManagedProcess process = new ManagedProcessBuilder("java") + .addArgument("-jar").addArgument("../gradle-it/build/gradle-it-runner.jar").build(); + process.start(); + try { given() .when().get("/hello")