From 2b9a3cf61df9d1390adc0ccf6e4077305c7d921d Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 9 Oct 2023 12:39:33 +0200 Subject: [PATCH] partially undo d80a638 due to surefire error https://issues.apache.org/jira/browse/SUREFIRE-2200 --- .../src/test/java/org/cryptomator/jfuse/api/FuseTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jfuse-api/src/test/java/org/cryptomator/jfuse/api/FuseTest.java b/jfuse-api/src/test/java/org/cryptomator/jfuse/api/FuseTest.java index 0e9e9a6..b2630bb 100644 --- a/jfuse-api/src/test/java/org/cryptomator/jfuse/api/FuseTest.java +++ b/jfuse-api/src/test/java/org/cryptomator/jfuse/api/FuseTest.java @@ -33,10 +33,10 @@ public void testWaitForMountingToComplete() throws IOException { Mockito.doReturn(fs).when(probePath).getFileSystem(); Mockito.doReturn(fsProv).when(fs).provider(); Mockito.doReturn(attrView).when(fsProv).getFileAttributeView(probePath, BasicFileAttributeView.class); - Mockito.doAnswer(_ -> { + Mockito.doAnswer(invocation -> { // first attempt: not yet mounted throw new NoSuchFileException("/mnt/jfuse_mount_probe not found"); - }).doAnswer(_ -> { + }).doAnswer(invocation -> { // second attempt: simulate hitting getattr fuse.fuseOperations.getattr("/jfuse_mount_probe", Mockito.mock(Stat.class), Mockito.mock(FileInfo.class)); throw new NoSuchFileException("/mnt/jfuse_mount_probe still not found"); @@ -79,7 +79,7 @@ public void testMountThrowsIllegalStateIfAlreadyMounted() throws InterruptedExce // mount probe succeeds immediately... Mockito.doNothing().when(fuse).waitForMountingToComplete(Mockito.eq(mountPoint), Mockito.any()); // ... before fuse_loop returns - Mockito.doAnswer(_ -> { + Mockito.doAnswer(invocation -> { Thread.sleep(1000); return 0; }).when(fuseMount).loop(); @@ -91,7 +91,7 @@ public void testMountThrowsIllegalStateIfAlreadyMounted() throws InterruptedExce @DisplayName("If fuse_loop instantly returns with non-zero result, throw FuseMountFailedException") public void testMountThrowsFuseMountFailedIfLoopReturnsNonZero() throws InterruptedException { // mount probe takes a while... - Mockito.doAnswer(_ -> { + Mockito.doAnswer(invocation -> { Thread.sleep(1000); return null; }).when(fuse).waitForMountingToComplete(Mockito.eq(mountPoint), Mockito.any());