verify(runner).stop();
verify(exit).exit(Exit.ERROR);
verify(logs).error("Caused by: NPE");
-
}
@Test
public void show_error() {
- Exception e = createException(false, false);
+ Exception e = createException(false);
testException(e, false);
verify(logs).error("Error during SonarQube Scanner execution");
@Test
public void show_error_MessageException() {
- Exception e = createException(false, true);
+ Exception e = createException(true);
testException(e, false);
verify(logs).error("Error during SonarQube Scanner execution");
@Test
public void show_error_debug() {
- Exception e = createException(true, false);
+ Exception e = createException(false);
testException(e, true);
verify(logs).error("Error during SonarQube Scanner execution", e);
verify(exit).exit(Exit.ERROR);
}
- private Exception createException(boolean debugEnabled, boolean messageException) {
+ private Exception createException(boolean messageException) {
Exception e;
if (messageException) {
e = new MessageException("my message");