diff options
Diffstat (limited to 'sonar-testing-harness/src')
-rw-r--r-- | sonar-testing-harness/src/main/java/org/sonar/test/ExceptionCauseMatcher.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/ExceptionCauseMatcher.java b/sonar-testing-harness/src/main/java/org/sonar/test/ExceptionCauseMatcher.java index 803e3527180..14da5daa22d 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/ExceptionCauseMatcher.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/ExceptionCauseMatcher.java @@ -70,7 +70,10 @@ public class ExceptionCauseMatcher extends TypeSafeMatcher<Throwable> { if (expectedMessage == null) { return true; } - return EXPECT_NO_MESSAGE_CONSTANT.equals(expectedMessage) ? item.getMessage() == null : item.getMessage().contains(expectedMessage); + if (EXPECT_NO_MESSAGE_CONSTANT.equals(expectedMessage)) { + return item.getMessage() == null; + } + return item.getMessage().contains(expectedMessage); } @Override |