Class LoggingTestKitImpl

    • 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 this LoggingTestKit has matched within the configured akka.actor.testkit.typed.filter-leeway as often as requested by its occurrences parameter specifies.
      <T> T expect​(scala.Function0<T> code, ActorSystem<?> system)
      Run the given code block and assert that the criteria of this LoggingTestKit has matched within the configured akka.actor.testkit.typed.filter-leeway as often as requested by its occurrences parameter specifies.
      int hashCode()  
      <T> T intercept​(scala.Function0<T> code, ActorSystem<?> system)
      Run the given code block and assert that the criteria of this LoggingTestKit has matched within the configured akka.actor.testkit.typed.filter-leeway as often as requested by its occurrences 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 included throwable that is a class or subclass of the given Throwable class.
      <A extends java.lang.Throwable>
      LoggingTestKitImpl
      withCause​(scala.reflect.ClassTag<A> evidence$1)
      Matching events with an included throwable that is a class or subclass of the given Throwable ClassTag.
      LoggingTestKitImpl withCustom​(scala.Function1<LoggingEvent,​java.lang.Object> newCustom)
      Matching events for which the supplied function returns true.
      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 given Map.
      LoggingTestKitImpl withMdc​(scala.collection.immutable.Map<java.lang.String,​java.lang.String> newMdc)
      Matching events with MDC containing all entries of the given Map.
      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 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface scala.Product

        productElementNames
    • 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

      • 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()
      • 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 this LoggingTestKit has matched within the configured akka.actor.testkit.typed.filter-leeway as often as requested by its occurrences parameter specifies.

        Care is taken to remove the testkit when the block is finished or aborted.

        Specified by:
        expect in interface LoggingTestKit
      • 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 this LoggingTestKit has matched within the configured akka.actor.testkit.typed.filter-leeway as often as requested by its occurrences parameter specifies.

        Care is taken to remove the testkit when the block is finished or aborted.

        Specified by:
        expect in class LoggingTestKit
      • 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 this LoggingTestKit has matched within the configured akka.actor.testkit.typed.filter-leeway as often as requested by its occurrences parameter specifies.

        Care is taken to remove the testkit when the block is finished or aborted.

        Specified by:
        intercept in interface LoggingTestKit
      • 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 interface LoggingTestKit
        Specified by:
        withOccurrences in class LoggingTestKit
      • withCause

        public <A extends java.lang.Throwable> LoggingTestKitImpl withCause​(scala.reflect.ClassTag<A> evidence$1)
        Description copied from interface: LoggingTestKit
        Matching events with an included throwable that is a class or subclass of the given Throwable ClassTag.
        Specified by:
        withCause in interface LoggingTestKit
      • 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 given Map. The event MDC may have more entries than the given Map.
        Specified by:
        withMdc in interface LoggingTestKit
      • 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 given Map. The event MDC may have more entries than the given Map.
        Specified by:
        withMdc in class LoggingTestKit
      • withCause

        public LoggingTestKit withCause​(java.lang.Class<? extends java.lang.Throwable> newCause)
        Description copied from class: LoggingTestKit
        Matching events with an included throwable that is a class or subclass of the given Throwable class.
        Specified by:
        withCause in class LoggingTestKit
      • 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 interface scala.Product
      • productArity

        public int productArity()
        Specified by:
        productArity in interface scala.Product
      • productElement

        public java.lang.Object productElement​(int x$1)
        Specified by:
        productElement in interface scala.Product
      • productIterator

        public scala.collection.Iterator<java.lang.Object> productIterator()
        Specified by:
        productIterator in interface scala.Product
      • canEqual

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • productElementName

        public java.lang.String productElementName​(int x$1)
        Specified by:
        productElementName in interface scala.Product
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object x$1)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object