Class 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>
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
iterablesFields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals -
Method Summary
Modifier and TypeMethodDescriptionVerifies 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 voidfailWithMessage(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.filteredByLoggerName(String loggerName) 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.filteredByMessagesMatching(String regex) 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.filteredByThrowableExactlyOfType(Class<? extends Throwable> throwableType) 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.hasAnyWithMessageMatching(String regex) 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.hasAnyWithThrowableExactlyOfType(Class<? extends Throwable> throwableType) 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.voidhasNoneWithMessage(BiPredicate<String, String> matcher, String expected, Object... args) Verifies that no log events have a message that matches the given matcher.voidhasNoneWithMessageContaining(String expectedMessage, Object... args) Verifies that no log events have a message that contains the expected message.voidhasNoneWithMessageEndingWith(String expectedMessage, Object... args) Verifies that no log events have a message that ends with the expected message.voidhasNoneWithMessageExactly(String expectedMessage, Object... args) Verifies that no log events have a message that exactly matches the expected message.voidhasNoneWithMessageMatching(String regex) Verifies that no log events have a message that matches the given regular expression.voidhasNoneWithMessageStartingWith(String expectedMessage, Object... args) Verifies that no log events have a message that starts with the expected message.protected LogEventsAssertnewAbstractIterableAssert(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.singleWithMessageMatching(String regex) 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.singleWithThrowableExactlyOfType(Class<? extends Throwable> throwableType) 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 LogEventAssertMethods 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, withThreadDumpOnErrorMethods inherited from class org.assertj.core.api.AbstractCollectionAssert
isUnmodifiableMethods 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, zipSatisfyMethods 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, withRepresentationMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptable
as, describedAsMethods inherited from interface org.assertj.core.api.EnumerableAssert
hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, isEmpty, isNullOrEmptyMethods 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
- Overrides:
failWithMessagein classorg.assertj.core.api.AbstractAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>>
-
toAssert
- Specified by:
toAssertin classorg.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:
newAbstractIterableAssertin classorg.assertj.core.api.AbstractIterableAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>
-
isNotEmpty
- Specified by:
isNotEmptyin interfaceorg.assertj.core.api.EnumerableAssert<LogEventsAssert, nl.altindag.log.model.LogEvent>- Overrides:
isNotEmptyin classorg.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
LogEventsAssertwill 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
LogEventsAssertcontaining 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
LogEventsAssertcontaining 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
LogEventAssertcontaining 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
LogEventsAssertwill 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
LogEventsAssertcontaining 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
LogEventsAssertcontaining 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
LogEventAssertcontaining 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
LogEventsAssertwill be empty but not fail.- Parameters:
expectedMessage- The expected message to match exactly.args- Optional arguments to format the expected message.- Returns:
- A new
LogEventsAssertcontaining 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
LogEventsAssertcontaining 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
LogEventAssertcontaining 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
LogEventsAssertwill 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
LogEventsAssertcontaining 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
LogEventsAssertcontaining 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
LogEventAssertcontaining 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
LogEventsAssertwill 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
LogEventsAssertcontaining 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
LogEventsAssertcontaining 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
LogEventAssertcontaining 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
Filters the log events that have a message matching the given regular expression.Note: If no log events match the expectation, the returned
LogEventsAssertwill be empty but not fail.- Parameters:
regex- The regular expression to match the log event messages against.- Returns:
- A new
LogEventsAssertcontaining the log events that match the expectation. This may be empty.
-
hasAnyWithMessageMatching
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
LogEventsAssertcontaining the log events that match the expectation. This is never empty.
-
singleWithMessageMatching
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
LogEventAssertcontaining the log event that matches the expectation.
-
hasNoneWithMessageMatching
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
Filters the log events by the given predicate.If no log events match the predicate, the returned
LogEventsAssertwill be empty (but not fail!).- Parameters:
predicate- The predicate to filter the log events by.- Returns:
- A new
LogEventsAssertcontaining the filtered log events. This may be empty.
-
hasAnyFilteredBy
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
LogEventsAssertcontaining the filtered log events. This is never empty.
-
singleFilteredBy
Verifies that exactly one log event matches the given predicate.- Parameters:
predicate- The predicate to filter the log events by.- Returns:
- A new
LogEventAssertcontaining the log event that matches the expectation.
-
filteredByThrowableOfType
Filters the log events by the given throwable type.Note: If no log events match the expectation, the returned
LogEventsAssertwill be empty but not fail.- Parameters:
throwableType- The type of the throwable to filter by.- Returns:
- A new
LogEventsAssertcontaining the filtered log events. This may be empty.
-
hasAnyWithThrowableOfType
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
LogEventsAssertcontaining the filtered log events. This is never empty.
-
singleWithThrowableOfType
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
LogEventAssertcontaining the log event that matches the expectation.
-
filteredByThrowableExactlyOfType
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
LogEventsAssertwill be empty but not fail.- Parameters:
throwableType- The type of the throwable to filter by.- Returns:
- A new
LogEventsAssertcontaining the filtered log events. This may be empty.
-
hasAnyWithThrowableExactlyOfType
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
LogEventsAssertcontaining the filtered log events. This is never empty.
-
singleWithThrowableExactlyOfType
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
LogEventAssertcontaining the log event that matches the expectation.
-
filteredByHasThrowable
Filters the log events that have any throwable associated with them.Note: If no log events match the expectation, the returned
LogEventsAssertwill be empty but not fail.- Returns:
- A new
LogEventsAssertcontaining the filtered log events. This may be empty.
-
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
LogEventsAssertcontaining the filtered log events. This is never empty.
-
singleWithThrowable
Verifies that exactly one log event has a throwable associated with it.- Returns:
- A new
LogEventAssertcontaining the log event that matches the expectation.
-
filteredByWithoutThrowable
Filters the log events that do not have any throwable associated with them.Note: If no log events match the expectation, the returned
LogEventsAssertwill be empty but not fail.- Returns:
- A new
LogEventsAssertcontaining the filtered log events. This may be empty.
-
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
LogEventsAssertcontaining the filtered log events. This is never empty.
-
singleWithoutThrowable
Verifies that exactly one log event does not have a throwable associated with it.- Returns:
- A new
LogEventAssertcontaining the log event that matches the expectation.
-
filteredByLoggerName
Filters the log events by the logger name.- Parameters:
loggerName- The name of the logger to filter by.- Returns:
- A new
LogEventsAssertcontaining the filtered log events.
-
singleElement
- Overrides:
singleElementin classorg.assertj.core.api.AbstractIterableAssert<LogEventsAssert, List<nl.altindag.log.model.LogEvent>, nl.altindag.log.model.LogEvent, LogEventAssert>
-