Skip to content

Commit 2b86f33

Browse files
committed
Add additional MountPoint.WithPath test for windows
1 parent 040bcce commit 2b86f33

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@
9292
</execution>
9393
</executions>
9494
</plugin>
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-surefire-plugin</artifactId>
98+
<version>3.0.0-M7</version>
99+
</plugin>
95100
<plugin>
96101
<artifactId>maven-javadoc-plugin</artifactId>
97102
<version>3.2.0</version>

src/test/java/org/cryptomator/integrations/mount/MountpointTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import org.junit.jupiter.api.Assertions;
44
import org.junit.jupiter.api.DisplayName;
55
import org.junit.jupiter.api.Test;
6+
import org.junit.jupiter.api.condition.DisabledOnOs;
7+
import org.junit.jupiter.api.condition.EnabledOnOs;
8+
import org.junit.jupiter.api.condition.OS;
69

710
import java.net.URI;
811
import java.nio.file.Path;
@@ -11,6 +14,7 @@ public class MountpointTest {
1114

1215
@Test
1316
@DisplayName("MountPoint.forPath()")
17+
@DisabledOnOs(OS.WINDOWS)
1418
public void testForPath() {
1519
var path = Path.of("/foo/bar");
1620
var mountPoint = Mountpoint.forPath(path);
@@ -23,6 +27,21 @@ public void testForPath() {
2327
}
2428
}
2529

30+
@Test
31+
@DisplayName("MountPoint.forPath() (Windows)")
32+
@EnabledOnOs(OS.WINDOWS)
33+
public void testForPathWindows() {
34+
var path = Path.of("D:\\foo\\bar");
35+
var mountPoint = Mountpoint.forPath(path);
36+
37+
if (mountPoint instanceof Mountpoint.WithPath m) {
38+
Assertions.assertEquals(path, m.path());
39+
Assertions.assertEquals(URI.create("file:///D:/foo/bar"), mountPoint.uri());
40+
} else {
41+
Assertions.fail();
42+
}
43+
}
44+
2645
@Test
2746
@DisplayName("MountPoint.forUri()")
2847
public void testForUri() {

0 commit comments

Comments
 (0)