Skip to content

Commit

Permalink
Fixes #155
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Jan 4, 2023
1 parent 682d494 commit 9faf121
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ public Path getPathToVault() {
public Path getCiphertextPath(Path cleartextPath) throws IOException {
var p = CryptoPath.castAndAssertAbsolute(cleartextPath);
var nodeType = cryptoPathMapper.getCiphertextFileType(p);
var cipherFile = cryptoPathMapper.getCiphertextFilePath(p);
if( nodeType == CiphertextFileType.DIRECTORY) {
return cryptoPathMapper.getCiphertextDir(p).path;
} else if( nodeType == CiphertextFileType.SYMLINK) {
}
var cipherFile = cryptoPathMapper.getCiphertextFilePath(p);
if( nodeType == CiphertextFileType.SYMLINK) {
return cipherFile.getSymlinkFilePath();
} else {
return cipherFile.getFilePath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;
Expand Down Expand Up @@ -204,6 +205,7 @@ public void testCleartextDirectory() throws IOException {

Path result = inTest.getCiphertextPath(cleartext);
Assertions.assertEquals(ciphertext, result);
Mockito.verify(cryptoPathMapper,never()).getCiphertextFilePath(any());
}
}

Expand Down

0 comments on commit 9faf121

Please sign in to comment.