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());