-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/test/java/org/cryptomator/frontend/fuse/mount/AbstractMountBuilderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.cryptomator.frontend.fuse.mount; | ||
|
||
import org.cryptomator.integrations.mount.Mount; | ||
import org.cryptomator.integrations.mount.MountFailedException; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.CsvSource; | ||
|
||
import java.nio.file.Path; | ||
import java.util.Arrays; | ||
|
||
public class AbstractMountBuilderTest { | ||
|
||
TestMountBuilder inTest = new TestMountBuilder(); | ||
|
||
@ParameterizedTest | ||
@CsvSource(textBlock = """ | ||
-asd,-asd | ||
-asd\t-qwe,-asd;-qwe | ||
-asd ,-asd | ||
-abc qwe,-abc qwe | ||
\t -foo file/to/use -bar 4 -b az not,-foo file/to/use;-bar 4;-b az not | ||
""") | ||
public void testSetMountFlags(String toTest, String expectedRaw) { | ||
var expected = Arrays.stream(expectedRaw.split(";")); | ||
|
||
inTest.setMountFlags(toTest); | ||
expected.forEach( exp -> Assertions.assertTrue(inTest.mountFlags.contains(exp))); | ||
} | ||
|
||
|
||
class TestMountBuilder extends AbstractMountBuilder { | ||
|
||
public TestMountBuilder() { | ||
super(Path.of("abc")); | ||
} | ||
|
||
@Override | ||
public Mount mount() throws MountFailedException { | ||
return null; | ||
} | ||
} | ||
} |