Class LoggingTestKitImpl
- java.lang.Object
-
- akka.actor.testkit.typed.javadsl.LoggingTestKit
-
- akka.actor.testkit.typed.internal.LoggingTestKitImpl
-
- All Implemented Interfaces:
LoggingTestKit
,java.io.Serializable
,scala.Equals
,scala.Product
public final class LoggingTestKitImpl extends LoggingTestKit implements LoggingTestKit, scala.Product, java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LoggingTestKitImpl(int occurrences, scala.Option<org.slf4j.event.Level> logLevel, scala.Option<java.lang.String> loggerName, scala.Option<java.lang.String> source, scala.Option<java.lang.String> messageContains, scala.Option<scala.util.matching.Regex> messageRegex, scala.Option<java.lang.Class<? extends java.lang.Throwable>> cause, scala.collection.immutable.Map<java.lang.String,java.lang.String> mdc, scala.Option<scala.Function1<LoggingEvent,java.lang.Object>> custom)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
apply(LoggingEvent event)
boolean
canEqual(java.lang.Object x$1)
scala.Option<java.lang.Class<? extends java.lang.Throwable>>
cause()
LoggingTestKitImpl
copy(int occurrences, scala.Option<org.slf4j.event.Level> logLevel, scala.Option<java.lang.String> loggerName, scala.Option<java.lang.String> source, scala.Option<java.lang.String> messageContains, scala.Option<scala.util.matching.Regex> messageRegex, scala.Option<java.lang.Class<? extends java.lang.Throwable>> cause, scala.collection.immutable.Map<java.lang.String,java.lang.String> mdc, scala.Option<scala.Function1<LoggingEvent,java.lang.Object>> custom)
int
copy$default$1()
scala.Option<org.slf4j.event.Level>
copy$default$2()
scala.Option<java.lang.String>
copy$default$3()
scala.Option<java.lang.String>
copy$default$4()
scala.Option<java.lang.String>
copy$default$5()
scala.Option<scala.util.matching.Regex>
copy$default$6()
scala.Option<java.lang.Class<? extends java.lang.Throwable>>
copy$default$7()
scala.collection.immutable.Map<java.lang.String,java.lang.String>
copy$default$8()
scala.Option<scala.Function1<LoggingEvent,java.lang.Object>>
copy$default$9()
scala.Option<scala.Function1<LoggingEvent,java.lang.Object>>
custom()
static LoggingTestKitImpl
empty()
boolean
equals(java.lang.Object x$1)
<T> T
expect(ActorSystem<?> system, java.util.function.Supplier<T> code)
Run the given code block and assert that the criteria of thisLoggingTestKit
has matched within the configuredakka.actor.testkit.typed.filter-leeway
as often as requested by itsoccurrences
parameter specifies.<T> T
expect(scala.Function0<T> code, ActorSystem<?> system)
Run the given code block and assert that the criteria of thisLoggingTestKit
has matched within the configuredakka.actor.testkit.typed.filter-leeway
as often as requested by itsoccurrences
parameter specifies.int
hashCode()
<T> T
intercept(scala.Function0<T> code, ActorSystem<?> system)
Run the given code block and assert that the criteria of thisLoggingTestKit
has matched within the configuredakka.actor.testkit.typed.filter-leeway
as often as requested by itsoccurrences
parameter specifies.scala.Option<java.lang.String>
loggerName()
scala.Option<org.slf4j.event.Level>
logLevel()
boolean
matches(LoggingEvent event)
scala.collection.immutable.Map<java.lang.String,java.lang.String>
mdc()
scala.Option<java.lang.String>
messageContains()
scala.Option<scala.util.matching.Regex>
messageRegex()
int
occurrences()
int
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
scala.Option<java.lang.String>
source()
java.lang.String
toString()
static scala.Option<scala.Tuple9<java.lang.Object,scala.Option<org.slf4j.event.Level>,scala.Option<java.lang.String>,scala.Option<java.lang.String>,scala.Option<java.lang.String>,scala.Option<scala.util.matching.Regex>,scala.Option<java.lang.Class<? extends java.lang.Throwable>>,scala.collection.immutable.Map<java.lang.String,java.lang.String>,scala.Option<scala.Function1<LoggingEvent,java.lang.Object>>>>
unapply(LoggingTestKitImpl x$0)
LoggingTestKit
withCause(java.lang.Class<? extends java.lang.Throwable> newCause)
Matching events with an includedthrowable
that is a class or subclass of the givenThrowable
class.<A extends java.lang.Throwable>
LoggingTestKitImplwithCause(scala.reflect.ClassTag<A> evidence$1)
Matching events with an includedthrowable
that is a class or subclass of the givenThrowable
ClassTag
.LoggingTestKitImpl
withCustom(scala.Function1<LoggingEvent,java.lang.Object> newCustom)
Matching events for which the supplied function returnstrue
.LoggingTestKitImpl
withLoggerName(java.lang.String newLoggerName)
Matching events with the given logger name or sub-names in the same way as configuration loggers are configured in logback.xml.LoggingTestKitImpl
withLogLevel(org.slf4j.event.Level newLogLevel)
Matching events with the given log level.LoggingTestKit
withMdc(java.util.Map<java.lang.String,java.lang.String> newMdc)
Matching events with MDC containing all entries of the givenMap
.LoggingTestKitImpl
withMdc(scala.collection.immutable.Map<java.lang.String,java.lang.String> newMdc)
Matching events with MDC containing all entries of the givenMap
.LoggingTestKitImpl
withMessageContains(java.lang.String newMessageContains)
Matching events with a message that contains the given value.LoggingTestKitImpl
withMessageRegex(java.lang.String newMessageRegex)
Matching events with a message that matches the given regular expression.LoggingTestKitImpl
withOccurrences(int newOccurrences)
Number of events the testkit is supposed to match.LoggingTestKitImpl
withSource(java.lang.String newSource)
Matching events that have "akkaSource" MDC value equal to the given value.-
Methods inherited from class akka.actor.testkit.typed.javadsl.LoggingTestKit
custom, deadLetters, debug, error, error, info, messageContains, trace, warn, warn
-
-
-
-
Constructor Detail
-
LoggingTestKitImpl
public LoggingTestKitImpl(int occurrences, scala.Option<org.slf4j.event.Level> logLevel, scala.Option<java.lang.String> loggerName, scala.Option<java.lang.String> source, scala.Option<java.lang.String> messageContains, scala.Option<scala.util.matching.Regex> messageRegex, scala.Option<java.lang.Class<? extends java.lang.Throwable>> cause, scala.collection.immutable.Map<java.lang.String,java.lang.String> mdc, scala.Option<scala.Function1<LoggingEvent,java.lang.Object>> custom)
-
-
Method Detail
-
empty
public static LoggingTestKitImpl empty()
-
unapply
public static scala.Option<scala.Tuple9<java.lang.Object,scala.Option<org.slf4j.event.Level>,scala.Option<java.lang.String>,scala.Option<java.lang.String>,scala.Option<java.lang.String>,scala.Option<scala.util.matching.Regex>,scala.Option<java.lang.Class<? extends java.lang.Throwable>>,scala.collection.immutable.Map<java.lang.String,java.lang.String>,scala.Option<scala.Function1<LoggingEvent,java.lang.Object>>>> unapply(LoggingTestKitImpl x$0)
-
occurrences
public int occurrences()
-
logLevel
public scala.Option<org.slf4j.event.Level> logLevel()
-
loggerName
public scala.Option<java.lang.String> loggerName()
-
source
public scala.Option<java.lang.String> source()
-
messageContains
public scala.Option<java.lang.String> messageContains()
-
messageRegex
public scala.Option<scala.util.matching.Regex> messageRegex()
-
cause
public scala.Option<java.lang.Class<? extends java.lang.Throwable>> cause()
-
mdc
public scala.collection.immutable.Map<java.lang.String,java.lang.String> mdc()
-
custom
public scala.Option<scala.Function1<LoggingEvent,java.lang.Object>> custom()
-
matches
public boolean matches(LoggingEvent event)
- Specified by:
matches
in interfaceLoggingTestKit
- Specified by:
matches
in classLoggingTestKit
- Returns:
true
if the event matches the conditions of the filter.
-
apply
public boolean apply(LoggingEvent event)
-
expect
public <T> T expect(scala.Function0<T> code, ActorSystem<?> system)
Description copied from interface:LoggingTestKit
Run the given code block and assert that the criteria of thisLoggingTestKit
has matched within the configuredakka.actor.testkit.typed.filter-leeway
as often as requested by itsoccurrences
parameter specifies.Care is taken to remove the testkit when the block is finished or aborted.
- Specified by:
expect
in interfaceLoggingTestKit
-
expect
public <T> T expect(ActorSystem<?> system, java.util.function.Supplier<T> code)
Description copied from class:LoggingTestKit
Run the given code block and assert that the criteria of thisLoggingTestKit
has matched within the configuredakka.actor.testkit.typed.filter-leeway
as often as requested by itsoccurrences
parameter specifies.Care is taken to remove the testkit when the block is finished or aborted.
- Specified by:
expect
in classLoggingTestKit
-
intercept
public <T> T intercept(scala.Function0<T> code, ActorSystem<?> system)
Description copied from interface:LoggingTestKit
Run the given code block and assert that the criteria of thisLoggingTestKit
has matched within the configuredakka.actor.testkit.typed.filter-leeway
as often as requested by itsoccurrences
parameter specifies.Care is taken to remove the testkit when the block is finished or aborted.
- Specified by:
intercept
in interfaceLoggingTestKit
-
withOccurrences
public LoggingTestKitImpl withOccurrences(int newOccurrences)
Description copied from class:LoggingTestKit
Number of events the testkit is supposed to match. By default 1.When occurrences > 0 it will not look for excess messages that are logged asynchronously outside (after) the
intercept
thunk and it has already found expected number.When occurrences is 0 it will look for unexpected matching events, and then it will also look for excess messages during the configured
akka.actor.testkit.typed.expect-no-message-default
duration.- Specified by:
withOccurrences
in interfaceLoggingTestKit
- Specified by:
withOccurrences
in classLoggingTestKit
-
withLogLevel
public LoggingTestKitImpl withLogLevel(org.slf4j.event.Level newLogLevel)
Description copied from class:LoggingTestKit
Matching events with the given log level.- Specified by:
withLogLevel
in interfaceLoggingTestKit
- Specified by:
withLogLevel
in classLoggingTestKit
-
withLoggerName
public LoggingTestKitImpl withLoggerName(java.lang.String newLoggerName)
Description copied from class:LoggingTestKit
Matching events with the given logger name or sub-names in the same way as configuration loggers are configured in logback.xml. By default the root logger is used.- Specified by:
withLoggerName
in interfaceLoggingTestKit
- Specified by:
withLoggerName
in classLoggingTestKit
-
withSource
public LoggingTestKitImpl withSource(java.lang.String newSource)
Description copied from class:LoggingTestKit
Matching events that have "akkaSource" MDC value equal to the given value. "akkaSource" is typically the actor path.- Specified by:
withSource
in interfaceLoggingTestKit
- Specified by:
withSource
in classLoggingTestKit
-
withMessageContains
public LoggingTestKitImpl withMessageContains(java.lang.String newMessageContains)
Description copied from class:LoggingTestKit
Matching events with a message that contains the given value.- Specified by:
withMessageContains
in interfaceLoggingTestKit
- Specified by:
withMessageContains
in classLoggingTestKit
-
withMessageRegex
public LoggingTestKitImpl withMessageRegex(java.lang.String newMessageRegex)
Description copied from class:LoggingTestKit
Matching events with a message that matches the given regular expression.- Specified by:
withMessageRegex
in interfaceLoggingTestKit
- Specified by:
withMessageRegex
in classLoggingTestKit
-
withCause
public <A extends java.lang.Throwable> LoggingTestKitImpl withCause(scala.reflect.ClassTag<A> evidence$1)
Description copied from interface:LoggingTestKit
Matching events with an includedthrowable
that is a class or subclass of the givenThrowable
ClassTag
.- Specified by:
withCause
in interfaceLoggingTestKit
-
withMdc
public LoggingTestKitImpl withMdc(scala.collection.immutable.Map<java.lang.String,java.lang.String> newMdc)
Description copied from interface:LoggingTestKit
Matching events with MDC containing all entries of the givenMap
. The event MDC may have more entries than the givenMap
.- Specified by:
withMdc
in interfaceLoggingTestKit
-
withMdc
public LoggingTestKit withMdc(java.util.Map<java.lang.String,java.lang.String> newMdc)
Description copied from class:LoggingTestKit
Matching events with MDC containing all entries of the givenMap
. The event MDC may have more entries than the givenMap
.- Specified by:
withMdc
in classLoggingTestKit
-
withCustom
public LoggingTestKitImpl withCustom(scala.Function1<LoggingEvent,java.lang.Object> newCustom)
Description copied from class:LoggingTestKit
Matching events for which the supplied function returnstrue
.- Specified by:
withCustom
in interfaceLoggingTestKit
- Specified by:
withCustom
in classLoggingTestKit
-
withCause
public LoggingTestKit withCause(java.lang.Class<? extends java.lang.Throwable> newCause)
Description copied from class:LoggingTestKit
Matching events with an includedthrowable
that is a class or subclass of the givenThrowable
class.- Specified by:
withCause
in classLoggingTestKit
-
copy
public LoggingTestKitImpl copy(int occurrences, scala.Option<org.slf4j.event.Level> logLevel, scala.Option<java.lang.String> loggerName, scala.Option<java.lang.String> source, scala.Option<java.lang.String> messageContains, scala.Option<scala.util.matching.Regex> messageRegex, scala.Option<java.lang.Class<? extends java.lang.Throwable>> cause, scala.collection.immutable.Map<java.lang.String,java.lang.String> mdc, scala.Option<scala.Function1<LoggingEvent,java.lang.Object>> custom)
-
copy$default$1
public int copy$default$1()
-
copy$default$2
public scala.Option<org.slf4j.event.Level> copy$default$2()
-
copy$default$3
public scala.Option<java.lang.String> copy$default$3()
-
copy$default$4
public scala.Option<java.lang.String> copy$default$4()
-
copy$default$5
public scala.Option<java.lang.String> copy$default$5()
-
copy$default$6
public scala.Option<scala.util.matching.Regex> copy$default$6()
-
copy$default$7
public scala.Option<java.lang.Class<? extends java.lang.Throwable>> copy$default$7()
-
copy$default$8
public scala.collection.immutable.Map<java.lang.String,java.lang.String> copy$default$8()
-
copy$default$9
public scala.Option<scala.Function1<LoggingEvent,java.lang.Object>> copy$default$9()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-