diff --git a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java index d8c678058038..32bc85f8f6bb 100644 --- a/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java +++ b/its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/Verifier.java @@ -594,25 +594,33 @@ public void verifyTextNotInLog(String text) throws VerificationException, IOExce } public static void verifyTextNotInLog(List lines, String text) throws VerificationException { - if (textOccurencesInLog(lines, text) > 0) { + if (textOccurrencesInLog(lines, text) > 0) { throw new VerificationException("Text found in log: " + text); } } public static void verifyTextInLog(List lines, String text) throws VerificationException { - if (textOccurencesInLog(lines, text) <= 0) { + if (textOccurrencesInLog(lines, text) <= 0) { throw new VerificationException("Text not found in log: " + text); } } public long textOccurrencesInLog(String text) throws IOException { - return textOccurencesInLog(loadLogLines(), text); + return textOccurrencesInLog(loadLogLines(), text); } - public static long textOccurencesInLog(List lines, String text) { + public static long textOccurrencesInLog(List lines, String text) { return lines.stream().filter(line -> stripAnsi(line).contains(text)).count(); } + /** + * @deprecated Use {@link #textOccurrencesInLog(List, String)} instead + */ + @Deprecated + public static long textOccurencesInLog(List lines, String text) { + return textOccurrencesInLog(lines, text); + } + /** * Checks whether the specified line is just an error message from Velocity. Especially old versions of Doxia employ * a very noisy Velocity instance.