@Test public void scheduledCommandsStarterShouldFetchFailedCommands() { final List<Command> failedCommands = Arrays.asList(); when(commandService.findFailedCommands()).thenReturn(failedCommands); commandTask.scheduledCommandsStarter(); verify(commandService).findFailedCommands(); }
@Scheduled(fixedRateString = "${kermoss.cs.config.rate}") public void scheduledCommandsStarter() { log.info("Start Processing Failed Commands"); final List<Command> commands = commandService.findFailedCommands(); log.info("Fetch {} Failed Commands", commands.size()); commands.parallelStream().forEach(c -> commandFeignClient.restartCommand(c.getId())); log.info("Finish Processing Failed Commands"); }
CommandTask { @Scheduled(fixedRateString = "${kermoss.cs.config.rate}") public void scheduledCommandsStarter() { log.info("Start Processing Failed Commands"); final List<Command> commands = commandService.findFailedCommands(); log.info("Fetch {} Failed Commands", commands.size()); commands.parallelStream().forEach(c -> commandFeignClient.restartCommand(c.getId())); log.info("Finish Processing Failed Commands"); } }
CommandTask { @Scheduled(fixedRateString = "${kermoss.cs.config.rate}") public void scheduledCommandsStarter() { log.info("Start Processing Failed Commands"); final List<Command> commands = commandService.findFailedCommands(); log.info("Fetch {} Failed Commands", commands.size()); commands.parallelStream().forEach(c -> commandFeignClient.restartCommand(c.getId())); log.info("Finish Processing Failed Commands"); } @Autowired  CommandTask(
        final CommandService commandService,
        final CommandFeignClient commandFeignClient
    ); }
CommandTask { @Scheduled(fixedRateString = "${kermoss.cs.config.rate}") public void scheduledCommandsStarter() { log.info("Start Processing Failed Commands"); final List<Command> commands = commandService.findFailedCommands(); log.info("Fetch {} Failed Commands", commands.size()); commands.parallelStream().forEach(c -> commandFeignClient.restartCommand(c.getId())); log.info("Finish Processing Failed Commands"); } @Autowired  CommandTask(
        final CommandService commandService,
        final CommandFeignClient commandFeignClient
    ); @Scheduled(fixedRateString = "${kermoss.cs.config.rate}") void scheduledCommandsStarter(); }
CommandTask { @Scheduled(fixedRateString = "${kermoss.cs.config.rate}") public void scheduledCommandsStarter() { log.info("Start Processing Failed Commands"); final List<Command> commands = commandService.findFailedCommands(); log.info("Fetch {} Failed Commands", commands.size()); commands.parallelStream().forEach(c -> commandFeignClient.restartCommand(c.getId())); log.info("Finish Processing Failed Commands"); } @Autowired  CommandTask(
        final CommandService commandService,
        final CommandFeignClient commandFeignClient
    ); @Scheduled(fixedRateString = "${kermoss.cs.config.rate}") void scheduledCommandsStarter();  }