Skip to content

Commit b422923

Browse files
committed
Protect against NPE in server tests
Update `AbstractApplicationLauncher` to not attempt to shutdown the process if startup fails.
1 parent e28338d commit b422923

File tree

1 file changed

+3
-1
lines changed
  • spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded

1 file changed

+3
-1
lines changed

spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/AbstractApplicationLauncher.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ protected AbstractApplicationLauncher(ApplicationBuilder applicationBuilder, Bui
5757

5858
@Override
5959
public void afterEach(ExtensionContext context) throws Exception {
60-
this.process.destroy();
60+
if (this.process != null) {
61+
this.process.destroy();
62+
}
6163
}
6264

6365
@Override

0 commit comments

Comments
 (0)