@Test public void testMoveToTrash_UsingTrash_VolMgrFailure() throws Exception { Path path = createMock(Path.class); expect(volMgr.moveToTrash(path)).andThrow(new FileNotFoundException()); replay(volMgr); assertFalse(gc.archiveOrMoveToTrash(path)); verify(volMgr); }
@Test public void testMoveToTrash_UsingTrash() throws Exception { Path path = createMock(Path.class); expect(volMgr.moveToTrash(path)).andReturn(true); replay(volMgr); assertTrue(gc.archiveOrMoveToTrash(path)); verify(volMgr); }
@Test public void testMoveToTrash_NotUsingTrash() throws Exception { systemConfig.set(Property.GC_TRASH_IGNORE.getKey(), "true"); Path path = createMock(Path.class); assertFalse(gc.archiveOrMoveToTrash(path)); }