Skip to content

Commit 84c5460

Browse files
committed
fix: change SampleAntApplicationIT to work in ci
1 parent b112f8f commit 84c5460

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/src/test/java/smoketest/ant/SampleAntApplicationIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import org.junit.jupiter.api.Test;
2424

25-
import org.springframework.boot.loader.tools.JavaExecutable;
25+
2626
import org.springframework.util.FileCopyUtils;
2727

2828
import static org.assertj.core.api.Assertions.assertThat;
@@ -38,9 +38,9 @@ class SampleAntApplicationIT {
3838
@Test
3939
void runJar() throws Exception {
4040
File libs = new File("build/ant/libs");
41-
Process process = new JavaExecutable().processBuilder("-jar", "spring-boot-smoke-test-ant.jar")
42-
.directory(libs)
43-
.start();
41+
ProcessBuilder processBuilder = new ProcessBuilder(new File(System.getProperty("java.home"), "bin/java").getAbsolutePath(),
42+
"-jar", "spring-boot-smoke-test-ant.jar");
43+
Process process = processBuilder.directory(libs).start();
4444
process.waitFor(5, TimeUnit.MINUTES);
4545
assertThat(process.exitValue()).isZero();
4646
String output = FileCopyUtils.copyToString(new InputStreamReader(process.getInputStream()));

0 commit comments

Comments
 (0)