Class LogEventsAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>>
org.assertj.core.api.AbstractIterableAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>
org.assertj.core.api.AbstractCollectionAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>
org.assertj.core.api.AbstractListAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>
nl.pim16aap2.testing.assertions.LogEventsAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>>, org.assertj.core.api.Descriptable<LogEventsAssert>, org.assertj.core.api.EnumerableAssert<LogEventsAssert, nl.altindag.log.model.LogEvent>, org.assertj.core.api.ExtensionPoints<LogEventsAssert, List<nl.altindag.log.model.LogEvent>>, org.assertj.core.api.IndexedObjectEnumerableAssert<LogEventsAssert, nl.altindag.log.model.LogEvent>, org.assertj.core.api.ObjectEnumerableAssert<LogEventsAssert, nl.altindag.log.model.LogEvent>

@NullMarked public class LogEventsAssert extends org.assertj.core.api.AbstractListAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>
An assertion class for a list of LogEvents.

This class provides methods to assert various conditions on a list of LogEvents. It extends AbstractAssert from AssertJ to provide fluent assertions.

  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractIterableAssert

    iterables

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Method Summary

    Modifier and Type
    Method
    Description
    Verifies that at least one log event has a throwable associated with it.
    Verifies that at least one log event has a throwable associated with it.
    protected void
    failWithMessage(String errorMessage, Object... arguments)
     
    filteredBy(Predicate<nl.altindag.log.model.LogEvent> predicate)
    Filters the log events by the given predicate.
    Filters the log events that have any throwable associated with them.
    Filters the log events by the logger name.
    filteredByMessage(BiPredicate<String,String> matcher, String expected, Object... args)
    Filters the log events that have a message matching the given matcher.
    filteredByMessagesContaining(String expectedMessage, Object... args)
    Filters the log events that have a message containing the expected message.
    filteredByMessagesEndingWith(String expectedMessage, Object... args)
    Filters the log events that have a message that ends with the expected message.
    filteredByMessagesExactly(String expectedMessage, Object... args)
    Filters the log events that have a message that exactly matches the expected message.
    Filters the log events that have a message matching the given regular expression.
    filteredByMessagesStartingWith(String expectedMessage, Object... args)
    Filters the log events that have a message that exactly matches the expected message.
    Filters the log events that have a throwable that is exactly of the given type associated with them.
    filteredByThrowableOfType(Class<? extends Throwable> throwableType)
    Filters the log events by the given throwable type.
    Filters the log events that do not have any throwable associated with them.
    hasAnyFilteredBy(Predicate<nl.altindag.log.model.LogEvent> predicate)
    Verifies that at least one log event matches the given predicate.
    hasAnyWithMessage(BiPredicate<String,String> matcher, String expected, Object... args)
    Verifies that at least one log event has a message that matches the given matcher.
    hasAnyWithMessageContaining(String expectedMessage, Object... args)
    Verifies that at least one log event has a message that contains the expected message.
    hasAnyWithMessageEndingWith(String expectedMessage, Object... args)
    Verifies that at least one log event has a message that ends with the expected message.
    hasAnyWithMessageExactly(String expectedMessage, Object... args)
    Verifies that at least one log event has a message that exactly matches the expected message.
    Verifies that at least one log event has a message that matches the given regular expression.
    hasAnyWithMessageStartingWith(String expectedMessage, Object... args)
    Verifies that at least one log event has a message that starts with the expected message.
    Verifies that at least one log event has a throwable that is of the given type.
    hasAnyWithThrowableOfType(Class<? extends Throwable> throwableType)
    Verifies that at least one log event has a throwable of the given type associated with it.
    void
    hasNoneWithMessage(BiPredicate<String,String> matcher, String expected, Object... args)
    Verifies that no log events have a message that matches the given matcher.
    void
    hasNoneWithMessageContaining(String expectedMessage, Object... args)
    Verifies that no log events have a message that contains the expected message.
    void
    hasNoneWithMessageEndingWith(String expectedMessage, Object... args)
    Verifies that no log events have a message that ends with the expected message.
    void
    hasNoneWithMessageExactly(String expectedMessage, Object... args)
    Verifies that no log events have a message that exactly matches the expected message.
    void
    Verifies that no log events have a message that matches the given regular expression.
    void
    hasNoneWithMessageStartingWith(String expectedMessage, Object... args)
    Verifies that no log events have a message that starts with the expected message.
     
    protected LogEventsAssert
    newAbstractIterableAssert(Iterable<? extends nl.altindag.log.model.LogEvent> iterable)
     
     
    singleFilteredBy(Predicate<nl.altindag.log.model.LogEvent> predicate)
    Verifies that exactly one log event matches the given predicate.
    singleWithMessage(BiPredicate<String,String> matcher, String expected, Object... args)
    Verifies that exactly one log event has a message that matches the given matcher.
    singleWithMessageContaining(String expectedMessage, Object... args)
    Verifies that exactly one log event has a message that contains the expected message.
    singleWithMessageEndingWith(String expectedMessage, Object... args)
    Verifies that exactly one log event has a message that ends with the expected message.
    singleWithMessageExactly(String expectedMessage, Object... args)
    Verifies that exactly one log event has a message that exactly matches the expected message.
    Verifies that exactly one log event has a message that matches the given regular expression.
    singleWithMessageStartingWith(String expectedMessage, Object... args)
    Verifies that exactly one log event has a message that starts with the expected message.
    Verifies that exactly one log event does not have a throwable associated with it.
    Verifies that exactly one log event has a throwable associated with it.
    Verifies that exactly one log event has a throwable that is exactly of the given type.
    singleWithThrowableOfType(Class<? extends Throwable> throwableType)
    Filters the log events that have exactly one throwable of the given type associated with them.
    protected LogEventAssert
    toAssert(nl.altindag.log.model.LogEvent value, String description)
     

    Methods inherited from class org.assertj.core.api.AbstractListAssert

    as, as, contains, describedAs, describedAs, doesNotContain, doesNotHave, doesNotHaveSameClassAs, has, has, hasSameClassAs, hasToString, is, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isOfAnyClassIn, isSameAs, isSorted, isSortedAccordingTo, overridingErrorMessage, satisfies, usingComparator, usingComparator, usingComparisonStrategy, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, withFailMessage, withThreadDumpOnError

    Methods inherited from class org.assertj.core.api.AbstractCollectionAssert

    isUnmodifiable

    Methods inherited from class org.assertj.core.api.AbstractIterableAssert

    allMatch, allMatch, allSatisfy, allSatisfy, anyMatch, anyMatch, anySatisfy, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsAnyOfForProxy, containsExactly, containsExactlyElementsOf, containsExactlyForProxy, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsExactlyInAnyOrderForProxy, containsForProxy, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyForProxy, containsOnlyNulls, containsOnlyOnce, containsOnlyOnceElementsOf, containsOnlyOnceForProxy, containsSequence, containsSequence, containsSequenceForProxy, containsSubsequence, containsSubsequence, containsSubsequenceForProxy, doesNotContain, doesNotContainAnyElementsOf, doesNotContainForProxy, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSequenceForProxy, doesNotContainSubsequence, doesNotContainSubsequence, doesNotContainSubsequenceForProxy, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doNotHave, element, element, elements, endsWith, endsWith, endsWithForProxy, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, extractingResultOf, extractingResultOf, filteredOn, filteredOn, filteredOn, filteredOn, filteredOn, filteredOnAssertions, filteredOnAssertions, filteredOnNull, first, first, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtractingForProxy, flatMap, flatMap, flatMap, flatMap, getComparatorsByType, getComparatorsForElementPropertyOrFieldTypes, hasAtLeastOneElementOfType, hasExactlyElementsOfTypes, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasOnlyOneElementSatisfying, hasSameElementsAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, inBinary, inHexadecimal, isEmpty, isNullOrEmpty, isSubsetOf, isSubsetOf, isSubsetOfForProxy, last, last, map, map, map, navigationDescription, newAbstractIterableAssertForProxy, noneMatch, noneMatch, noneSatisfy, noneSatisfy, satisfiesExactly, satisfiesExactly, satisfiesExactlyForProxy, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrderForProxy, satisfiesOnlyOnce, satisfiesOnlyOnce, satisfiesOnlyOnceForProxy, singleElement, size, startsWith, startsWithForProxy, usingComparatorForElementFieldsWithNames, usingComparatorForElementFieldsWithType, usingComparatorForType, usingElementComparatorIgnoringFields, usingElementComparatorOnFields, usingFieldByFieldElementComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparatorIgnoringFields, usingRecursiveFieldByFieldElementComparatorOnFields, zipSatisfy

    Methods inherited from class org.assertj.core.api.AbstractAssert

    actual, areEqual, asInstanceOf, asList, assertionError, asString, descriptionText, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, getWritableAssertionInfo, hashCode, hasSameHashCodeAs, hasToString, isElementOfCustomAssert, isInstanceOfSatisfying, isNull, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingEquals, usingEquals, withFailMessage, withRepresentation

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, describedAs

    Methods inherited from interface org.assertj.core.api.EnumerableAssert

    hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, isEmpty, isNullOrEmpty

    Methods inherited from interface org.assertj.core.api.ObjectEnumerableAssert

    allMatch, allMatch, allSatisfy, allSatisfy, anyMatch, anyMatch, anySatisfy, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsExactly, containsExactlyElementsOf, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyNulls, containsOnlyOnce, containsOnlyOnceElementsOf, containsSequence, containsSequence, containsSubsequence, containsSubsequence, doesNotContain, doesNotContainAnyElementsOf, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSubsequence, doesNotContainSubsequence, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doNotHave, endsWith, endsWith, hasAtLeastOneElementOfType, hasExactlyElementsOfTypes, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasOnlyOneElementSatisfying, hasSameElementsAs, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, isSubsetOf, isSubsetOf, noneMatch, noneMatch, noneSatisfy, noneSatisfy, satisfiesExactly, satisfiesExactly, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrder, satisfiesOnlyOnce, satisfiesOnlyOnce, startsWith
  • Method Details

    • failWithMessage

      protected void failWithMessage(String errorMessage, Object... arguments)
      Overrides:
      failWithMessage in class org.assertj.core.api.AbstractAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>>
    • toAssert

      protected LogEventAssert toAssert(nl.altindag.log.model.LogEvent value, String description)
      Specified by:
      toAssert in class org.assertj.core.api.AbstractIterableAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>
    • newAbstractIterableAssert

      protected LogEventsAssert newAbstractIterableAssert(Iterable<? extends nl.altindag.log.model.LogEvent> iterable)
      Specified by:
      newAbstractIterableAssert in class org.assertj.core.api.AbstractIterableAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>
    • isNotEmpty

      public LogEventsAssert isNotEmpty()
      Specified by:
      isNotEmpty in interface org.assertj.core.api.EnumerableAssert<LogEventsAssert, nl.altindag.log.model.LogEvent>
      Overrides:
      isNotEmpty in class org.assertj.core.api.AbstractIterableAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>
    • filteredByMessage

      @FormatMethod public LogEventsAssert filteredByMessage(BiPredicate<String,String> matcher, @FormatString String expected, Object... args)
      Filters the log events that have a message matching the given matcher.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Example usage:

      .withMessage(String::contains, "Expected message")
      
      Parameters:
      matcher - The matcher to apply to the log event messages.
      expected - The expected message to match against.
      args - The optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This may be empty.
    • hasAnyWithMessage

      @FormatMethod public LogEventsAssert hasAnyWithMessage(BiPredicate<String,String> matcher, @FormatString String expected, Object... args)
      Verifies that at least one log event has a message that matches the given matcher.

      This method is similar to filteredByMessage(BiPredicate, String, Object...) but asserts that the result is not empty.

      Example usage:

      .hasAnyWithMessage(String::startsWith, "Expected message")
      
      Parameters:
      matcher - The matcher to apply to the log event messages.
      expected - The expected message to match against.
      args - The optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This is never empty.
    • singleWithMessage

      @FormatMethod public LogEventAssert singleWithMessage(BiPredicate<String,String> matcher, @FormatString String expected, Object... args)
      Verifies that exactly one log event has a message that matches the given matcher.

      This method is similar to filteredByMessage(BiPredicate, String, Object...) but asserts that the result contains exactly one element.

      Example usage:

      .singleWithMessage(String::contains, "Expected message")
      
      Parameters:
      matcher - The matcher to apply to the log event messages.
      expected - The expected message to match against.
      args - The optional arguments to format the expected message.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • hasNoneWithMessage

      @FormatMethod public void hasNoneWithMessage(BiPredicate<String,String> matcher, @FormatString String expected, Object... args)
      Verifies that no log events have a message that matches the given matcher.

      This method is similar to filteredByMessage(BiPredicate, String, Object...) but asserts that the result is empty.

      Example usage:

      .hasNoneWithMessage(String::contains, "Unexpected message")
      
      Parameters:
      matcher - The matcher to apply to the log event messages.
      expected - The expected message to match against.
      args - The optional arguments to format the expected message.
    • filteredByMessagesContaining

      @FormatMethod public LogEventsAssert filteredByMessagesContaining(@FormatString String expectedMessage, Object... args)
      Filters the log events that have a message containing the expected message.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Parameters:
      expectedMessage - The expected message to be contained in the log event messages.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This may be empty.
    • hasAnyWithMessageContaining

      @FormatMethod public LogEventsAssert hasAnyWithMessageContaining(@FormatString String expectedMessage, Object... args)
      Verifies that at least one log event has a message that contains the expected message.

      This method is similar to filteredByMessagesContaining(String, Object...) but asserts that the result is not empty.

      Parameters:
      expectedMessage - The expected message to be contained in the log event messages.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This is never empty.
    • singleWithMessageContaining

      @FormatMethod public LogEventAssert singleWithMessageContaining(@FormatString String expectedMessage, Object... args)
      Verifies that exactly one log event has a message that contains the expected message.
      Parameters:
      expectedMessage - The expected message to be contained in the log event messages.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • hasNoneWithMessageContaining

      @FormatMethod public void hasNoneWithMessageContaining(@FormatString String expectedMessage, Object... args)
      Verifies that no log events have a message that contains the expected message.
      Parameters:
      expectedMessage - The message that should not be contained in any log event messages.
      args - Optional arguments to format the expected message.
    • filteredByMessagesExactly

      @FormatMethod public LogEventsAssert filteredByMessagesExactly(@FormatString String expectedMessage, Object... args)
      Filters the log events that have a message that exactly matches the expected message.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Parameters:
      expectedMessage - The expected message to match exactly.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This may be empty.
    • hasAnyWithMessageExactly

      @FormatMethod public LogEventsAssert hasAnyWithMessageExactly(@FormatString String expectedMessage, Object... args)
      Verifies that at least one log event has a message that exactly matches the expected message.

      This method is similar to filteredByMessagesExactly(String, Object...) but asserts that the result is not empty.

      Parameters:
      expectedMessage - The expected message to match exactly.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This is never empty.
    • singleWithMessageExactly

      @FormatMethod public LogEventAssert singleWithMessageExactly(@FormatString String expectedMessage, Object... args)
      Verifies that exactly one log event has a message that exactly matches the expected message.
      Parameters:
      expectedMessage - The expected message to match exactly.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • hasNoneWithMessageExactly

      @FormatMethod public void hasNoneWithMessageExactly(@FormatString String expectedMessage, Object... args)
      Verifies that no log events have a message that exactly matches the expected message.
      Parameters:
      expectedMessage - The message that should not exactly match any log event messages.
      args - Optional arguments to format the expected message.
    • filteredByMessagesStartingWith

      @FormatMethod public LogEventsAssert filteredByMessagesStartingWith(@FormatString String expectedMessage, Object... args)
      Filters the log events that have a message that exactly matches the expected message.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Parameters:
      expectedMessage - The expected message to be at the start of the log event messages.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This may be empty.
    • hasAnyWithMessageStartingWith

      @FormatMethod public LogEventsAssert hasAnyWithMessageStartingWith(@FormatString String expectedMessage, Object... args)
      Verifies that at least one log event has a message that starts with the expected message.

      This method is similar to filteredByMessagesStartingWith(String, Object...) but asserts that the result is not empty.

      Parameters:
      expectedMessage - The expected message to be at the start of the log event messages.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This is never empty.
    • singleWithMessageStartingWith

      @FormatMethod public LogEventAssert singleWithMessageStartingWith(@FormatString String expectedMessage, Object... args)
      Verifies that exactly one log event has a message that starts with the expected message.
      Parameters:
      expectedMessage - The expected message to be at the start of the log event messages.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • hasNoneWithMessageStartingWith

      @FormatMethod public void hasNoneWithMessageStartingWith(@FormatString String expectedMessage, Object... args)
      Verifies that no log events have a message that starts with the expected message.
      Parameters:
      expectedMessage - The message that should not be at the start of any log event messages.
      args - Optional arguments to format the expected message.
    • filteredByMessagesEndingWith

      @FormatMethod public LogEventsAssert filteredByMessagesEndingWith(@FormatString String expectedMessage, Object... args)
      Filters the log events that have a message that ends with the expected message.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Parameters:
      expectedMessage - The expected message to be at the end of the log event messages.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This may be empty.
    • hasAnyWithMessageEndingWith

      @FormatMethod public LogEventsAssert hasAnyWithMessageEndingWith(@FormatString String expectedMessage, Object... args)
      Verifies that at least one log event has a message that ends with the expected message.

      This method is similar to filteredByMessagesEndingWith(String, Object...) but asserts that the result is not empty.

      Parameters:
      expectedMessage - The expected message to be at the end of the log event messages.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This is never empty.
    • singleWithMessageEndingWith

      @FormatMethod public LogEventAssert singleWithMessageEndingWith(@FormatString String expectedMessage, Object... args)
      Verifies that exactly one log event has a message that ends with the expected message.
      Parameters:
      expectedMessage - The expected message to be at the end of the log event messages.
      args - Optional arguments to format the expected message.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • hasNoneWithMessageEndingWith

      @FormatMethod public void hasNoneWithMessageEndingWith(@FormatString String expectedMessage, Object... args)
      Verifies that no log events have a message that ends with the expected message.
      Parameters:
      expectedMessage - The message that should not be at the end of any log event messages.
      args - Optional arguments to format the expected message.
    • filteredByMessagesMatching

      public LogEventsAssert filteredByMessagesMatching(String regex)
      Filters the log events that have a message matching the given regular expression.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Parameters:
      regex - The regular expression to match the log event messages against.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This may be empty.
    • hasAnyWithMessageMatching

      public LogEventsAssert hasAnyWithMessageMatching(String regex)
      Verifies that at least one log event has a message that matches the given regular expression.

      This method is similar to filteredByMessagesMatching(String) but asserts that the result is not empty.

      Parameters:
      regex - The regular expression to match the log event messages against.
      Returns:
      A new LogEventsAssert containing the log events that match the expectation. This is never empty.
    • singleWithMessageMatching

      public LogEventAssert singleWithMessageMatching(String regex)
      Verifies that exactly one log event has a message that matches the given regular expression.
      Parameters:
      regex - The regular expression to match the log event messages against.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • hasNoneWithMessageMatching

      public void hasNoneWithMessageMatching(String regex)
      Verifies that no log events have a message that matches the given regular expression.
      Parameters:
      regex - The regular expression that should not match any log event messages.
    • filteredBy

      public LogEventsAssert filteredBy(Predicate<nl.altindag.log.model.LogEvent> predicate)
      Filters the log events by the given predicate.

      If no log events match the predicate, the returned LogEventsAssert will be empty (but not fail!).

      Parameters:
      predicate - The predicate to filter the log events by.
      Returns:
      A new LogEventsAssert containing the filtered log events. This may be empty.
    • hasAnyFilteredBy

      public LogEventsAssert hasAnyFilteredBy(Predicate<nl.altindag.log.model.LogEvent> predicate)
      Verifies that at least one log event matches the given predicate.

      This method is similar to filteredBy(Predicate) but asserts that the result is not empty.

      Parameters:
      predicate - The predicate to filter the log events by.
      Returns:
      A new LogEventsAssert containing the filtered log events. This is never empty.
    • singleFilteredBy

      public LogEventAssert singleFilteredBy(Predicate<nl.altindag.log.model.LogEvent> predicate)
      Verifies that exactly one log event matches the given predicate.
      Parameters:
      predicate - The predicate to filter the log events by.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • filteredByThrowableOfType

      public LogEventsAssert filteredByThrowableOfType(Class<? extends Throwable> throwableType)
      Filters the log events by the given throwable type.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Parameters:
      throwableType - The type of the throwable to filter by.
      Returns:
      A new LogEventsAssert containing the filtered log events. This may be empty.
    • hasAnyWithThrowableOfType

      public LogEventsAssert hasAnyWithThrowableOfType(Class<? extends Throwable> throwableType)
      Verifies that at least one log event has a throwable of the given type associated with it.

      This method is similar to filteredByThrowableOfType(Class) but asserts that the result is not empty.

      Parameters:
      throwableType - The type of the throwable to check for.
      Returns:
      A new LogEventsAssert containing the filtered log events. This is never empty.
    • singleWithThrowableOfType

      public LogEventAssert singleWithThrowableOfType(Class<? extends Throwable> throwableType)
      Filters the log events that have exactly one throwable of the given type associated with them.
      Parameters:
      throwableType - The type of the throwable to filter by.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • filteredByThrowableExactlyOfType

      public LogEventsAssert filteredByThrowableExactlyOfType(Class<? extends Throwable> throwableType)
      Filters the log events that have a throwable that is exactly of the given type associated with them.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Parameters:
      throwableType - The type of the throwable to filter by.
      Returns:
      A new LogEventsAssert containing the filtered log events. This may be empty.
    • hasAnyWithThrowableExactlyOfType

      public LogEventsAssert hasAnyWithThrowableExactlyOfType(Class<? extends Throwable> throwableType)
      Verifies that at least one log event has a throwable that is of the given type.

      This method is similar to filteredByThrowableOfType(Class) but asserts that the result is not empty.

      Parameters:
      throwableType - The type of the throwable to check for.
      Returns:
      A new LogEventsAssert containing the filtered log events. This is never empty.
    • singleWithThrowableExactlyOfType

      public LogEventAssert singleWithThrowableExactlyOfType(Class<? extends Throwable> throwableType)
      Verifies that exactly one log event has a throwable that is exactly of the given type.
      Parameters:
      throwableType - The type of the throwable to check for.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • filteredByHasThrowable

      public LogEventsAssert filteredByHasThrowable()
      Filters the log events that have any throwable associated with them.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Returns:
      A new LogEventsAssert containing the filtered log events. This may be empty.
    • anyWithThrowable

      public LogEventsAssert anyWithThrowable()
      Verifies that at least one log event has a throwable associated with it.

      This method is similar to filteredByHasThrowable() but asserts that the result is not empty.

      Returns:
      A new LogEventsAssert containing the filtered log events. This is never empty.
    • singleWithThrowable

      public LogEventAssert singleWithThrowable()
      Verifies that exactly one log event has a throwable associated with it.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • filteredByWithoutThrowable

      public LogEventsAssert filteredByWithoutThrowable()
      Filters the log events that do not have any throwable associated with them.

      Note: If no log events match the expectation, the returned LogEventsAssert will be empty but not fail.

      Returns:
      A new LogEventsAssert containing the filtered log events. This may be empty.
    • anyWithoutThrowable

      public LogEventsAssert anyWithoutThrowable()
      Verifies that at least one log event has a throwable associated with it.

      This method is similar to filteredByHasThrowable() but asserts that the result is not empty.

      Returns:
      A new LogEventsAssert containing the filtered log events. This is never empty.
    • singleWithoutThrowable

      public LogEventAssert singleWithoutThrowable()
      Verifies that exactly one log event does not have a throwable associated with it.
      Returns:
      A new LogEventAssert containing the log event that matches the expectation.
    • filteredByLoggerName

      public LogEventsAssert filteredByLoggerName(String loggerName)
      Filters the log events by the logger name.
      Parameters:
      loggerName - The name of the logger to filter by.
      Returns:
      A new LogEventsAssert containing the filtered log events.
    • singleElement

      public LogEventAssert singleElement()
      Overrides:
      singleElement in class org.assertj.core.api.AbstractIterableAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>