Skip to content

Commit 8499d3e

Browse files
committed
add condition, that token is removed from map
1 parent 8d4d232 commit 8499d3e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/test/java/org/cryptomator/cryptofs/inuse/RealUseTokenTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@ private static void assertInUseFile(String expectedOwner, Path filePath) throws
8888
public void testValidFileContent() throws IOException {
8989
var filePath = tmpDir.resolve("inUse.file");
9090
try (var token = new RealUseToken(filePath, "test3000", cryptor, useTokens, tokenPersistor, CREATION_DELAY_MILLIS, StandardOpenOption.CREATE_NEW, encWrapper)) {
91+
useTokens.put(filePath, token);
9192
Awaitility.await().atLeast(FILE_OPERATION_DELAY) //
9293
.atMost(FILE_OPERATION_MAX) //
9394
.untilAsserted(() -> assertInUseFile("test3000", filePath));
9495
}
9596
Assertions.assertTrue(Files.notExists(filePath));
97+
Assertions.assertNull(useTokens.get(filePath));
9698
}
9799

98100
@Test

0 commit comments

Comments
 (0)