Packages

package javadsl

Type Members

  1. final class LogCapturingJunit4 extends TestRule

    See https://doc.akka.io/docs/akka/current/typed/testing-async.html#silence-logging-output-from-tests

    See https://doc.akka.io/docs/akka/current/typed/testing-async.html#silence-logging-output-from-tests

    JUnit TestRule to make log lines appear only when the test failed.

    Use this in test by adding a public field annotated with @Rule:

    @Rule public final LogCapturingJunit4 logCapturing = new LogCapturingJunit4();

    Requires Logback and configuration like the following the logback-test.xml:

    <appender name="CapturingAppender" class="akka.actor.testkit.typed.internal.CapturingAppender" />
    
    <logger name="akka.actor.testkit.typed.internal.CapturingAppenderDelegate" >
      <appender-ref ref="STDOUT"/>
    </logger>
    
    <root level="DEBUG">
        <appender-ref ref="CapturingAppender"/>
    </root>

Ungrouped