@Test
public void testResourceIsInUseHasAnActiveApp() throws Exception {

  FileSystem fs = mock(FileSystem.class);
  CleanerMetrics metrics = mock(CleanerMetrics.class);
  SCMStore store = mock(SCMStore.class);
  FileStatus resource = mock(FileStatus.class);
  when(resource.getPath()).thenReturn(new Path(ROOT + "/a/b/c/abc"));
  // resource is stale
  when(store.isResourceEvictable(isA(String.class), isA(FileStatus.class)))
      .thenReturn(true);
  // but still has appIds
  when(store.removeResource(isA(String.class))).thenReturn(false);
  CleanerTask task =
      createSpiedTask(fs, store, metrics, new ReentrantLock());
  // process the resource
  task.processSingleResource(resource);
  // metrics should record a processed file (but not delete)
  verify(metrics).reportAFileProcess();
  verify(metrics, never()).reportAFileDelete();
}