test_class.declarator: scheduler
test_class.modifier: @InjectMocks
      @Spy
      private
test_class.original_string: @InjectMocks
      @Spy
      private MaintenanceScheduler scheduler;
test_class.type: MaintenanceScheduler
test_class.var_name: scheduler
test_class.declarator: listTask = new ArrayList<>()
test_class.modifier: @Spy
      private
test_class.original_string: @Spy
      private List<MaintenanceTaskProcess> listTask = new ArrayList<>();
test_class.type: List<MaintenanceTaskProcess>
test_class.var_name: listTask
test_class.declarator: security
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Security security;
test_class.type: Security
test_class.var_name: security
test_class.file: dataprep-maintenance/src/test/java/org/talend/dataprep/maintenance/executor/MaintenanceSchedulerTest.java
test_class.identifier: MaintenanceSchedulerTest
test_class.superclass: extends BaseMaintenanceTest
test_case.body: @Test
      public void testScheduleNight() {
  
          scheduler.launchNightlyTask();
  
          // only task with ScheduleFrequency = NIGHT are call
          verify(listTask.get(2), times(1)).performTask();
          verify(listTask.get(3), times(0)).performTask();
          verify(listTask.get(6), times(1)).performTask();
  
          listTask
                  .stream() //
                  .filter(task -> !(task instanceof MockScheduledNightlyTask))
                  .forEach(task -> {
                      verify(task, times(0)).performTask();
                      verify(task, times(0)).condition();
                      verify(task, times(0)).execute();
                  });
      }
test_case.class_method_signature: MaintenanceSchedulerTest.testScheduleNight()
test_case.full_signature: @Test public void testScheduleNight()
test_case.identifier: testScheduleNight
test_case.invocations: launchNightlyTask performTask verify get times performTask verify get times performTask verify get times forEach filter stream performTask verify times condition verify times execute verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testScheduleNight()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(MaintenanceScheduler.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(MaintenanceScheduler.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: maintenanceTasks
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private List<MaintenanceTaskProcess> maintenanceTasks;
focal_class.type: List<MaintenanceTaskProcess>
focal_class.var_name: maintenanceTasks
focal_class.declarator: forAll
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ForAll forAll;
focal_class.type: ForAll
focal_class.var_name: forAll
focal_class.declarator: security
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private Security security;
focal_class.type: Security
focal_class.var_name: security
focal_class.declarator: taskExecutor
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private TaskExecutor taskExecutor;
focal_class.type: TaskExecutor
focal_class.var_name: taskExecutor
focal_class.declarator: runningTask = new ConcurrentHashMap<>()
focal_class.modifier: private
focal_class.original_string: private Map<String, Long> runningTask = new ConcurrentHashMap<>();
focal_class.type: Map<String, Long>
focal_class.var_name: runningTask
focal_class.file: dataprep-maintenance/src/main/java/org/talend/dataprep/maintenance/executor/MaintenanceScheduler.java
focal_class.identifier: MaintenanceScheduler
focal_class.class_method_signature: MaintenanceScheduler.launchOnceTask()
focal_class.full_signature: @PostConstruct public void launchOnceTask()
focal_class.identifier: launchOnceTask
focal_class.modifiers: @PostConstruct public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void launchOnceTask()
focal_class.class_method_signature: MaintenanceScheduler.launchNightlyTask()
focal_class.full_signature: @Scheduled(cron = "${maintenance.scheduled.cron}") public void launchNightlyTask()
focal_class.identifier: launchNightlyTask
focal_class.modifiers: @Scheduled(cron = "${maintenance.scheduled.cron}") public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void launchNightlyTask()
focal_class.class_method_signature: MaintenanceScheduler.launchRepeatlyTask()
focal_class.full_signature: @Scheduled(fixedDelayString = "${maintenance.scheduled.fixed-delay}", initialDelayString = "${maintenance.scheduled.initial-delay}") public void launchRepeatlyTask()
focal_class.identifier: launchRepeatlyTask
focal_class.modifiers: @Scheduled(fixedDelayString = "${maintenance.scheduled.fixed-delay}", initialDelayString = "${maintenance.scheduled.initial-delay}") public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void launchRepeatlyTask()
focal_class.class_method_signature: MaintenanceScheduler.runMaintenanceTask(ScheduleFrequency frequency)
focal_class.full_signature: private void runMaintenanceTask(ScheduleFrequency frequency)
focal_class.identifier: runMaintenanceTask
focal_class.modifiers: private
focal_class.parameters: (ScheduleFrequency frequency)
focal_class.return: void
focal_class.signature: void runMaintenanceTask(ScheduleFrequency frequency)
focal_class.class_method_signature: MaintenanceScheduler.executeTask(String tenantId, MaintenanceTaskProcess task, String taskKey)
focal_class.full_signature: private void executeTask(String tenantId, MaintenanceTaskProcess task, String taskKey)
focal_class.identifier: executeTask
focal_class.modifiers: private
focal_class.parameters: (String tenantId, MaintenanceTaskProcess task, String taskKey)
focal_class.return: void
focal_class.signature: void executeTask(String tenantId, MaintenanceTaskProcess task, String taskKey)
focal_class.class_method_signature: MaintenanceScheduler.isAlreadyRunning(String taskKey)
focal_class.full_signature: protected boolean isAlreadyRunning(String taskKey)
focal_class.identifier: isAlreadyRunning
focal_class.modifiers: protected
focal_class.parameters: (String taskKey)
focal_class.return: boolean
focal_class.signature: boolean isAlreadyRunning(String taskKey)
focal_method.body: @Scheduled(cron = "${maintenance.scheduled.cron}")
      public void launchNightlyTask() {
          runMaintenanceTask(NIGHT);
      }
focal_method.class_method_signature: MaintenanceScheduler.launchNightlyTask()
focal_method.full_signature: @Scheduled(cron = "${maintenance.scheduled.cron}") public void launchNightlyTask()
focal_method.identifier: launchNightlyTask
focal_method.invocations: runMaintenanceTask
focal_method.modifiers: @Scheduled(cron = "${maintenance.scheduled.cron}") public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void launchNightlyTask()