Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 24273c6

Browse files
committed
Fix test by adjusting precision while comaparing mod dates in LocalFsCloudProviderTest
1 parent de63a85 commit 24273c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/java/org/cryptomator/cloudaccess/localfs/LocalFsCloudProviderTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.nio.file.Path;
2121
import java.time.Duration;
2222
import java.time.Instant;
23+
import java.time.temporal.ChronoUnit;
2324
import java.util.Optional;
2425
import java.util.concurrent.ExecutionException;
2526
import java.util.stream.Collectors;
@@ -146,7 +147,7 @@ public void testWriteToAndReplaceExistingFile() throws IOException {
146147
public void testWriteToNewFileUpdateModificationDate() throws IOException {
147148
var in = new ByteArrayInputStream("hallo welt".getBytes());
148149

149-
var modDate = Instant.now().minus(Duration.ofDays(365));
150+
var modDate = Instant.now().minus(Duration.ofDays(365)).truncatedTo(ChronoUnit.MILLIS);
150151

151152
var result = provider.write(CloudPath.of("/file"), false, in, 10, Optional.of(modDate), ProgressListener.NO_PROGRESS_AWARE);
152153
Assertions.assertTimeoutPreemptively(Duration.ofSeconds(1), () -> result.toCompletableFuture().get());

0 commit comments

Comments
 (0)