Skip to content

Commit c95a403

Browse files
committed
add unit test to cover new code
1 parent e82018c commit c95a403

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test/java/org/cryptomator/cryptofs/DirectoryIdBackupTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ public void beforeEachRead() throws IOException {
9797
decChannel = mock(DecryptingReadableByteChannel.class);
9898
}
9999

100+
@Test
101+
@DisplayName("If the given path is not a cipherContentDir, throw IllegalArgumentException")
102+
public void wrongPath() throws IOException {
103+
var dirIdBackupSpy = spy(dirIdBackup);
104+
Assertions.assertThrows(IllegalArgumentException.class, () -> dirIdBackupSpy.read(testDir));
105+
}
106+
100107
@Test
101108
@DisplayName("If the directory id is longer than 36 characters, throw IllegalStateException")
102109
public void contentLongerThan36Chars() throws IOException {

0 commit comments

Comments
 (0)