Switch to a RuntimeException as NPE has a message on Java 15

Closes gh-22136
pull/22139/head
Andy Wilkinson 4 years ago
parent 12add61504
commit f6400e95ee

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -141,7 +141,7 @@ class CommandRunnerTests {
@Test @Test
void handlesRegularExceptionWithoutMessage() throws Exception { void handlesRegularExceptionWithoutMessage() throws Exception {
willThrow(new NullPointerException()).given(this.regularCommand).run(); willThrow(new RuntimeException()).given(this.regularCommand).run();
int status = this.commandRunner.runAndHandleErrors("command"); int status = this.commandRunner.runAndHandleErrors("command");
assertThat(status).isEqualTo(1); assertThat(status).isEqualTo(1);
assertThat(this.calls).containsOnly(Call.ERROR_MESSAGE, Call.PRINT_STACK_TRACE); assertThat(this.calls).containsOnly(Call.ERROR_MESSAGE, Call.PRINT_STACK_TRACE);

Loading…
Cancel
Save