diff --git a/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/JournalCorruptionEofIndexRecoveryTest.java b/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/JournalCorruptionEofIndexRecoveryTest.java index 0033e0b2c7..da89e5fd83 100644 --- a/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/JournalCorruptionEofIndexRecoveryTest.java +++ b/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/JournalCorruptionEofIndexRecoveryTest.java @@ -239,8 +239,13 @@ public class JournalCorruptionEofIndexRecoveryTest { final var appender = new AbstractAppender("testAppender", new AbstractFilter() {}, new MessageLayout(), false, new Property[0]) { @Override public void append(LogEvent event) { - if (event.getLevel() == Level.WARN + if (event != null + && event.getLevel() == Level.WARN + && event.getMessage() != null + && event.getMessage().getFormattedMessage() != null && event.getMessage().getFormattedMessage().contains("Cannot recover message audit") + && event.getThrown() != null + && event.getThrown().getLocalizedMessage() != null && event.getThrown().getLocalizedMessage().contains("Invalid location size")) { trappedExpectedLogMessage.set(true); }