@Test public void shouldGetStaticTriggers() throws Exception { int page = 1; int pageSize = 10; List<TriggerEvent> expectedTriggers = prepareTriggers(); QueryParams params = new QueryParams(page, pageSize); when(triggerEventsDataService.byChannelModuleName(MODULE_NAME, params)).thenReturn(expectedTriggers); List<TriggerEvent> triggers = triggerEventService.getStaticTriggers(MODULE_NAME, page, pageSize); verify(triggerEventsDataService, times(1)).byChannelModuleName(eq(MODULE_NAME), eq(params)); assertEquals(expectedTriggers, triggers); }
@Override @Transactional public List<TriggerEvent> getStaticTriggers(String moduleName, int page, int pageSize) { return triggerEventsDataService.byChannelModuleName(moduleName, new QueryParams(page, pageSize)); }
TriggerEventServiceImpl implements TriggerEventService { @Override @Transactional public List<TriggerEvent> getStaticTriggers(String moduleName, int page, int pageSize) { return triggerEventsDataService.byChannelModuleName(moduleName, new QueryParams(page, pageSize)); } }
TriggerEventServiceImpl implements TriggerEventService { @Override @Transactional public List<TriggerEvent> getStaticTriggers(String moduleName, int page, int pageSize) { return triggerEventsDataService.byChannelModuleName(moduleName, new QueryParams(page, pageSize)); }  }
TriggerEventServiceImpl implements TriggerEventService { @Override @Transactional public List<TriggerEvent> getStaticTriggers(String moduleName, int page, int pageSize) { return triggerEventsDataService.byChannelModuleName(moduleName, new QueryParams(page, pageSize)); }  @Override @Transactional List<TriggerEvent> getDynamicTriggers(String moduleName, int page, int pareSize); @Override @Transactional List<TriggerEvent> getStaticTriggers(String moduleName, int page, int pageSize); @Override @Transactional TriggerEvent getTrigger(TaskTriggerInformation triggerInformation); @Override @Transactional boolean triggerExists(TaskTriggerInformation information); @Override boolean providesDynamicTriggers(String moduleName); @Override @Transactional long countStaticTriggers(String moduleName); @Override long countDynamicTriggers(String moduleName); @Override @Transactional Set<TaskError> validateTrigger(TaskTriggerInformation trigger); @Autowired void setTriggerEventsDataService(TriggerEventsDataService triggerEventsDataService); @Autowired void setChannelsDataService(ChannelsDataService channelsDataService); @Autowired void setDynamicChannelLoader(DynamicChannelLoader dynamicChannelLoader); }
TriggerEventServiceImpl implements TriggerEventService { @Override @Transactional public List<TriggerEvent> getStaticTriggers(String moduleName, int page, int pageSize) { return triggerEventsDataService.byChannelModuleName(moduleName, new QueryParams(page, pageSize)); }  @Override @Transactional List<TriggerEvent> getDynamicTriggers(String moduleName, int page, int pareSize); @Override @Transactional List<TriggerEvent> getStaticTriggers(String moduleName, int page, int pageSize); @Override @Transactional TriggerEvent getTrigger(TaskTriggerInformation triggerInformation); @Override @Transactional boolean triggerExists(TaskTriggerInformation information); @Override boolean providesDynamicTriggers(String moduleName); @Override @Transactional long countStaticTriggers(String moduleName); @Override long countDynamicTriggers(String moduleName); @Override @Transactional Set<TaskError> validateTrigger(TaskTriggerInformation trigger); @Autowired void setTriggerEventsDataService(TriggerEventsDataService triggerEventsDataService); @Autowired void setChannelsDataService(ChannelsDataService channelsDataService); @Autowired void setDynamicChannelLoader(DynamicChannelLoader dynamicChannelLoader);  }