Skip to content

Commit 0254df7

Browse files
committed
INVALID - add logs
add traces on build server
1 parent f4fd7b2 commit 0254df7

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@
7575
<version>[3.9.1]</version>
7676
<scope>test</scope>
7777
</dependency>
78-
<dependency>
79-
<groupId>org.slf4j</groupId>
80-
<artifactId>slf4j-nop</artifactId>
81-
<version>[1.7.25]</version>
82-
<scope>test</scope>
78+
<dependency>
79+
<groupId>ch.qos.logback</groupId>
80+
<artifactId>logback-classic</artifactId>
81+
<version>1.2.3</version>
82+
<scope>test</scope>
8383
</dependency>
8484
</dependencies>
8585
</project>

src/test/java/com/github/stefanbirkner/fakesftpserver/rule/FakeSftpServerRuleTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.jcraft.jsch.ChannelSftp;
3232
import com.jcraft.jsch.JSch;
3333
import com.jcraft.jsch.JSchException;
34+
import com.jcraft.jsch.Logger;
3435
import com.jcraft.jsch.Session;
3536
import com.jcraft.jsch.SftpException;
3637

@@ -341,6 +342,17 @@ public void the_last_key_is_effective_if_addIdentity_is_called_multiple_times()
341342
FakeSftpServerRule sftpServer = new FakeSftpServerRule()
342343
.addIdentity("dummy user", EMPTY_AUTHORIZED_KEYS)
343344
.addIdentity("dummy user", DUMMY_AUTHORIZED_KEYS);
345+
JSCH.setLogger(new Logger() {
346+
@Override
347+
public void log(int level, String message) {
348+
log.info(message);
349+
}
350+
351+
@Override
352+
public boolean isEnabled(int level) {
353+
return true;
354+
}
355+
});
344356
executeTestWithRule(
345357
() -> {
346358
Session session = createSessionWithIdentity(
@@ -354,6 +366,7 @@ public void the_last_key_is_effective_if_addIdentity_is_called_multiple_times()
354366
},
355367
sftpServer
356368
);
369+
JSCH.setLogger(null);
357370
}
358371
}
359372

0 commit comments

Comments
 (0)