Skip to content

Commit

Permalink
partially undo d80a638 due to surefire error
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Oct 9, 2023
1 parent 20431b6 commit 2b9a3cf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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();
Expand All @@ -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());
Expand Down

0 comments on commit 2b9a3cf

Please sign in to comment.