public class LevelAssert extends org.assertj.core.api.AbstractAssert<C,TestLogger>
TestLogger, for a
specific log level.| Modifier and Type | Field and Description |
|---|---|
protected Supplier<List<LoggingEvent>> |
loggingEventsSupplier |
| Constructor and Description |
|---|
LevelAssert(TestLogger logger,
org.slf4j.event.Level level) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
protected static LoggingEvent |
event(org.slf4j.event.Level level,
String message,
Object... arguments) |
protected static LoggingEvent |
event(Throwable throwable,
org.slf4j.event.Level level,
String message,
Object... arguments) |
protected long |
getLogCount(org.slf4j.event.Level level,
Predicate<LoggingEvent> predicate) |
int |
hashCode() |
LevelAssert |
hasMessageContaining(String substring)
Assert that the given log level includes a log message that contains a substring.
|
LevelAssert |
hasMessageMatching(String regex)
Assert that the given log level includes a log message that matches a regex.
|
LevelAssert |
hasNumberOfLogs(int expected)
Assert that the given log level has the expected number of logs, regardless of content.
|
protected static Predicate<LoggingEvent> |
logWithMessage(String message,
Object... arguments) |
protected static Predicate<LoggingEvent> |
logWithMessage(String message,
Optional<Throwable> maybeThrowable,
Object... arguments) |
actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnErrorprotected Supplier<List<LoggingEvent>> loggingEventsSupplier
public LevelAssert(TestLogger logger, org.slf4j.event.Level level)
public LevelAssert hasNumberOfLogs(int expected)
expected - the number of logs expected at this levelLevelAssert for chainingpublic LevelAssert hasMessageContaining(String substring)
substring - a substring of a log message that should be presentLevelAssert for chainingpublic LevelAssert hasMessageMatching(String regex)
regex - the regular expression to which this string is to be matchedLevelAssert for chainingpublic boolean equals(Object o)
equals in interface org.assertj.core.api.Assert<LevelAssert,TestLogger>equals in class org.assertj.core.api.AbstractAssert<LevelAssert,TestLogger>public int hashCode()
hashCode in class org.assertj.core.api.AbstractAssert<LevelAssert,TestLogger>protected long getLogCount(org.slf4j.event.Level level,
Predicate<LoggingEvent> predicate)
protected static Predicate<LoggingEvent> logWithMessage(String message, Object... arguments)
protected static Predicate<LoggingEvent> logWithMessage(String message, Optional<Throwable> maybeThrowable, Object... arguments)
protected static LoggingEvent event(org.slf4j.event.Level level, String message, Object... arguments)
protected static LoggingEvent event(Throwable throwable, org.slf4j.event.Level level, String message, Object... arguments)
Copyright © 2025. All rights reserved.