Skip to content

Commit

Permalink
adapt InvocationTest to more recent versions of slf4j
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Apr 29, 2024
1 parent cb1bf60 commit 275299b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import ch.qos.logback.classic.testUtil.StringPrintStream;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class InvocationTest {
Expand All @@ -19,6 +20,8 @@ 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]";

@BeforeEach
public void setUp() throws Exception {
System.setErr(sps);
Expand All @@ -37,7 +40,8 @@ public void smoke() {
Logger logger = LoggerFactory.getLogger(this.getClass());
logger.debug("Hello world.");

assertTrue(sps.stringList.isEmpty());
assertEquals(1, sps.stringList.size());
assertEquals(CONNECTED_WITH_MESSAGE, sps.stringList.get(0));

}

Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<modelVersion>4.0.0</modelVersion>


<groupId>ch.qos.logback</groupId>
<artifactId>logback-parent</artifactId>
<version>1.5.7-SNAPSHPOT</version>
Expand Down Expand Up @@ -43,6 +44,7 @@
<module>logback-core-blackbox</module>
<module>logback-classic</module>
<module>logback-classic-blackbox</module>
<module>logback-access</module>
<module>logback-examples</module>
</modules>

Expand Down

0 comments on commit 275299b

Please sign in to comment.