Skip to content

Commit d302804

Browse files
artembilanspring-builds
authored andcommitted
Remove applySystemFileSeparator() from SmbTestSupport
Related to: #9453 The `SmbSession` does not rely on a system file separator anymore and just use regular Unix `/` separator all the time. Therefore, `TestUtils.applySystemFileSeparator()` is wrong from test perspective on Windows (cherry picked from commit 64b49d1)
1 parent 671c906 commit d302804

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

spring-integration-smb/src/test/java/org/springframework/integration/smb/SmbTestSupport.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 the original author or authors.
2+
* Copyright 2022-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,7 +33,6 @@
3333
import org.springframework.integration.file.remote.session.Session;
3434
import org.springframework.integration.file.remote.session.SessionFactory;
3535
import org.springframework.integration.smb.session.SmbSessionFactory;
36-
import org.springframework.integration.test.util.TestUtils;
3736

3837
/**
3938
* Provides a connection to a Testcontainers-driven SMB Server for test cases.
@@ -101,17 +100,12 @@ public static void connectToSMBServer() throws IOException {
101100
try (Session<SmbFile> smbFileSession = smbSessionFactory.getSession()) {
102101
smbFileSession.mkdir("smbTarget");
103102
Charset charset = StandardCharsets.UTF_8;
104-
smbFileSession.write(IOUtils.toInputStream("source1", charset),
105-
TestUtils.applySystemFileSeparator("smbSource/smbSource1.txt"));
106-
smbFileSession.write(IOUtils.toInputStream("source2", charset),
107-
TestUtils.applySystemFileSeparator("smbSource/smbSource2.txt"));
103+
smbFileSession.write(IOUtils.toInputStream("source1", charset), "smbSource/smbSource1.txt");
104+
smbFileSession.write(IOUtils.toInputStream("source2", charset), "smbSource/smbSource2.txt");
108105
smbFileSession.write(IOUtils.toInputStream("", charset), "SMBSOURCE1.TXT.a");
109106
smbFileSession.write(IOUtils.toInputStream("", charset), "SMBSOURCE2.TXT.a");
110-
111-
smbFileSession.write(IOUtils.toInputStream("subSource1", charset),
112-
TestUtils.applySystemFileSeparator("smbSource/subSmbSource/subSmbSource1.txt"));
113-
smbFileSession.write(IOUtils.toInputStream("subSource2", charset),
114-
TestUtils.applySystemFileSeparator("smbSource/subSmbSource/subSmbSource2.txt"));
107+
smbFileSession.write(IOUtils.toInputStream("subSource1", charset), "smbSource/subSmbSource/subSmbSource1.txt");
108+
smbFileSession.write(IOUtils.toInputStream("subSource2", charset), "smbSource/subSmbSource/subSmbSource2.txt");
115109
}
116110
}
117111

0 commit comments

Comments
 (0)