Skip to content

Commit f6400e9

Browse files
committed
Switch to a RuntimeException as NPE has a message on Java 15
Closes gh-22136
1 parent 12add61 commit f6400e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -141,7 +141,7 @@ void handlesRegularExceptionWithMessage() throws Exception {
141141

142142
@Test
143143
void handlesRegularExceptionWithoutMessage() throws Exception {
144-
willThrow(new NullPointerException()).given(this.regularCommand).run();
144+
willThrow(new RuntimeException()).given(this.regularCommand).run();
145145
int status = this.commandRunner.runAndHandleErrors("command");
146146
assertThat(status).isEqualTo(1);
147147
assertThat(this.calls).containsOnly(Call.ERROR_MESSAGE, Call.PRINT_STACK_TRACE);

0 commit comments

Comments
 (0)