JobSchedulerFeService extends CommonJobConfigurationFeService { public MapJobSchedulerConfigurationModel getMapJobConfigurationModel(final String applicationInstanceId) { final LightminClientApplication lightminClientApplication = this.findLightminClientApplicatonById(applicationInstanceId); final Map<String, JobConfigurations> jobConfigurations = this.adminServerService.getJobConfigurationsMap(lightminClientApplication); final MapJobSchedulerConfigurationModel mapJobSchedulerConfigurationModel = new MapJobSchedulerConfigurationModel(); for (final Map.Entry<String, JobConfigurations> entry : jobConfigurations.entrySet()) { for (final JobConfiguration jobConfiguration : entry.getValue().getJobConfigurations()) { if (jobConfiguration.getJobSchedulerConfiguration() != null) { final SchedulerJobConfigurationModel model = this.map(jobConfiguration); mapJobSchedulerConfigurationModel.add(entry.getKey(), model); } else { log.trace("No Scheduler configuration, nothing to map"); } } } return mapJobSchedulerConfigurationModel; } JobSchedulerFeService(final RegistrationBean registrationBean, final AdminServerService adminServerService); MapJobSchedulerConfigurationModel getMapJobConfigurationModel(final String applicationInstanceId); SchedulerJobConfigurationModel getJobConfigurationModel(final Long jobConfigurationId,
                                                                   final String applicationInstanceId); void startScheduler(final Long jobConfigurationId, final String applicationInstanceId); void stopScheduler(final Long jobConfigurationId, final String applicationInstanceId); void deleteSchedulerConfiguration(final Long jobConfigurationId, final String applicationInstanceId); void addSchedulerConfiguration(final SchedulerJobConfigurationModel schedulerModel,
                                          final String applicationInstanceId); void updateSchedulerConfiguration(final SchedulerJobConfigurationModel schedulerModel,
                                             final String applicationInstanceId);  }
@Test public void testGetMapJobConfigurationModel() { final LightminClientApplication lightminClientApplication = ServiceTestHelper.createLightminClientApplication(); when(this.registrationBean.findById(APPLICATION_INSTANCE_ID)).thenReturn(lightminClientApplication); final Map<String, JobConfigurations> jobConfigurationsMap = new HashMap<>(); ApiTestHelper.addJobConfigurations(jobConfigurationsMap, APPLICATION_INSTANCE_ID, ApiTestHelper.createJobSchedulerConfigurations(5)); when(this.adminServerService.getJobConfigurationsMap(lightminClientApplication)).thenReturn(jobConfigurationsMap); final MapJobSchedulerConfigurationModel result = this.jobSchedulerFeService.getMapJobConfigurationModel(APPLICATION_INSTANCE_ID); BDDAssertions.then(result).isNotNull(); BDDAssertions.then(result.getJobConfigurations()).isNotNull(); BDDAssertions.then(result.getJobConfigurations().size()).isEqualTo(1); }