From f6400e95eea4dadc195bafc74b2ac588a7b837d7 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Sat, 27 Jun 2020 09:31:39 +0100 Subject: [PATCH] Switch to a RuntimeException as NPE has a message on Java 15 Closes gh-22136 --- .../springframework/boot/cli/command/CommandRunnerTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java index f26c8c35de..0bd3e95b7c 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -141,7 +141,7 @@ class CommandRunnerTests { @Test void handlesRegularExceptionWithoutMessage() throws Exception { - willThrow(new NullPointerException()).given(this.regularCommand).run(); + willThrow(new RuntimeException()).given(this.regularCommand).run(); int status = this.commandRunner.runAndHandleErrors("command"); assertThat(status).isEqualTo(1); assertThat(this.calls).containsOnly(Call.ERROR_MESSAGE, Call.PRINT_STACK_TRACE);