From 8935470736a395429ebcd0fbf75794a83ca37cec Mon Sep 17 00:00:00 2001 From: Ceki Gulcu Date: Sun, 5 Jan 2025 22:03:47 +0100 Subject: [PATCH] adapt test to SLF4J version 2.0.16 Signed-off-by: Ceki Gulcu --- .../test/java/ch/qos/logback/classic/spi/InvocationTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/spi/InvocationTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/spi/InvocationTest.java index 0ae721ed6d..c4da6d3f82 100644 --- a/logback-classic/src/test/java/ch/qos/logback/classic/spi/InvocationTest.java +++ b/logback-classic/src/test/java/ch/qos/logback/classic/spi/InvocationTest.java @@ -13,6 +13,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.slf4j.helpers.Reporter.SLF4J_INTERNAL_VERBOSITY_KEY; public class InvocationTest { @@ -20,10 +21,11 @@ public class InvocationTest { final String loggerName = this.getClass().getName(); StringPrintStream sps = new StringPrintStream(oldErr, true); - String CONNECTED_WITH_MESSAGE = "SLF4J(I): Connected with provider of type [ch.qos.logback.classic.spi.LogbackServiceProvider]"; + String CONNECTED_WITH_MESSAGE = "SLF4J(D): Connected with provider of type [ch.qos.logback.classic.spi.LogbackServiceProvider]"; @BeforeEach public void setUp() throws Exception { + System.setProperty(SLF4J_INTERNAL_VERBOSITY_KEY, "debug"); System.setErr(sps); } @@ -31,6 +33,7 @@ public void setUp() throws Exception { public void tearDown() throws Exception { LoggerFactoryFriend.reset(); System.setErr(oldErr); + System.clearProperty(SLF4J_INTERNAL_VERBOSITY_KEY); } // https://jira.qos.ch/browse/LOGBACK-1568 would have been prevented