You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a way to easily reset the Logback logging system, for example from an @AfterAll method:
@AfterAllstaticvoidresetLogback() {
LogbackTestHelpers.resetLogback(); // uses default logback-test.xml// could provide an overload too:LogbackTestHelpers.resetLogback("acme-special-logback-test.xml");
}
The final solution might not look like the above, i.e., the class name may be different, maybe we use instance methods instead of static, etc.
* Add LogbackTestHelpers utility class. This provides utilities
to reset Logback.
* Add ResetLogbackLoggingExtension, a Jupiter extension to
reset Logback after all tests have run.
* Add UncheckedJoranException, which wraps the checked
Logback JoranException.
* Update several tests that use Dropwizard extensions to use
ResetLogbackLoggingExtension to restore logging.
Closes#460Closes#461
* Add LogbackTestHelpers utility class. This provides static
utilities to reset Logback.
* Add LogbackTestHelper which mainly delegates to LogbackTestHelpers.
It adds a new method, resetLogbackWithDefaultOrConfig, which removes
the duplicate conditional logic in the InMemoryAppenderExtension and
the ResetLogbackLoggingExtension. It also allows for mocking in
tests of the Logback reset mechanisms and extensions.
* Add ResetLogbackLoggingExtension, a Jupiter extension to
reset Logback after all tests have run.
* Add UncheckedJoranException, which wraps the checked
Logback JoranException.
* Update several tests that use Dropwizard extensions to use
ResetLogbackLoggingExtension to restore logging.
* Replace duplicate code in InMemoryAppenderExtension with
call to LogbackTestHelpers#resetLogback
Misc cleanup:
* Make visibility of Dropwizard Configuration classes in
several tests the same as the Application class
* Add test for InMemoryAppenderExtension.
* Add "clear-box" tests for InMemoryAppenderExtension#getAppender
Closes#460Closes#461
Provide a way to easily reset the Logback logging system, for example from an
@AfterAll
method:The final solution might not look like the above, i.e., the class name may be different, maybe we use instance methods instead of static, etc.
For more background see #457
The text was updated successfully, but these errors were encountered: