WorkspaceActivityChecker { @ScheduleDelay( initialDelayParameterName = "che.workspace.activity_check_scheduler_delay_s", delayParameterName = "che.workspace.activity_check_scheduler_period_s") @VisibleForTesting void expire() { stopAllExpired(); } @Inject  WorkspaceActivityChecker(
      WorkspaceActivityDao activityDao,
      WorkspaceManager workspaceManager,
      WorkspaceRuntimes workspaceRuntimes,
      WorkspaceActivityManager workspaceActivityManager); @VisibleForTesting  WorkspaceActivityChecker(
      WorkspaceActivityDao activityDao,
      WorkspaceManager workspaceManager,
      WorkspaceRuntimes workspaceRuntimes,
      WorkspaceActivityManager workspaceActivityManager,
      Clock clock);   }
@Test public void shouldStopAllExpiredWorkspaces() throws Exception { when(workspaceActivityDao.findExpiredIdle(anyLong())).thenReturn(asList("1", "2", "3")); checker.expire(); verify(workspaceActivityDao, times(3)).removeExpiration(anyString()); verify(workspaceActivityDao).removeExpiration(eq("1")); verify(workspaceActivityDao).removeExpiration(eq("2")); verify(workspaceActivityDao).removeExpiration(eq("3")); }