JobListenerFeService extends CommonJobConfigurationFeService { public void addListenerConfiguration(final ListenerJobConfigurationModel listenerModel, final String applicationInstanceId) { final LightminClientApplication lightminClientApplication = this.findLightminClientApplicatonById(applicationInstanceId); final JobConfiguration jobConfiguration = this.map(listenerModel); this.adminServerService.saveJobConfiguration(jobConfiguration, lightminClientApplication); } JobListenerFeService(final RegistrationBean registrationBean, final AdminServerService adminServerService); MapJobListenerConfigurationModel getMapJobConfigurationModel(final String applicationInstanceId); ListenerJobConfigurationModel getJobConfigurationModel(final Long jobConfigurationId,
                                                                  final String applicationInstanceId); void startListener(final Long jobConfigurationId, final String applicationInstanceId); void stopListener(final Long jobConfigurationId, final String applicationInstanceId); void deleteListenerConfiguration(final Long jobConfigurationId, final String applicationInstanceId); void addListenerConfiguration(final ListenerJobConfigurationModel listenerModel,
                                         final String applicationInstanceId); void updateListenerConfiguration(final ListenerJobConfigurationModel listenerModel,
                                            final String applicationInstanceId);  }
@Test public void testAddListenerConfiguration() { final LightminClientApplication lightminClientApplication = ServiceTestHelper.createLightminClientApplication(); when(this.registrationBean.findById(APPLICATION_INSTANCE_ID)).thenReturn(lightminClientApplication); final ListenerJobConfigurationModel listenerJobConfigurationModel = ServiceTestHelper.createListenerJobConfigurationModel("testJob"); try { this.jobListenerFeService.addListenerConfiguration(listenerJobConfigurationModel, APPLICATION_INSTANCE_ID); verify(this.adminServerService, times(1)). saveJobConfiguration(this.jobListenerFeService.map( listenerJobConfigurationModel), lightminClientApplication); } catch (final Exception e) { fail(e.getMessage()); } }