package javadsl
Type Members
- final class LogCapturingJunit4 extends TestRule
See https://pekko.apache.org/docs/pekko/current/typed/testing-async.html#silence-logging-output-from-tests
See https://pekko.apache.org/docs/pekko/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="org.apache.pekko.actor.testkit.typed.internal.CapturingAppender" /> <logger name="org.apache.pekko.actor.testkit.typed.internal.CapturingAppenderDelegate" > <appender-ref ref="STDOUT"/> </logger> <root level="DEBUG"> <appender-ref ref="CapturingAppender"/> </root>