DynamicChannelLoaderImpl implements DynamicChannelLoader { @Override @Transactional public List<TriggerEvent> getDynamicTriggers(String moduleName, int page, int pageSize) { LOGGER.debug("Retrieving dynamic triggers for channel {}", moduleName); DynamicChannelProvider provider = getChannelProvider(moduleName); if (provider != null) { return provider.getTriggers(page, pageSize); } else { LOGGER.debug(PROVIDER_NOT_FOUND, moduleName); } return new ArrayList<>(); } @Autowired  DynamicChannelLoaderImpl(BundleContext bundleContext); @Override @Transactional List<TriggerEvent> getDynamicTriggers(String moduleName, int page, int pageSize); @Override boolean providesDynamicTriggers(String moduleName); @Override Long countByChannelModuleName(String moduleName); @Override @Transactional TriggerEvent getTrigger(TaskTriggerInformation triggerInformation); @Override boolean channelExists(String moduleName); @Override boolean validateTrigger(String moduleName, String subject);  }
@Test public void testGetDynamicTriggers() throws Exception { List<TriggerEvent> triggerEvents = prepareTriggerEvents(); when(provider.getTriggers(1, 10)).thenReturn(triggerEvents); List<TriggerEvent> fetched = channelLoader.getDynamicTriggers(MODULE_SYMBOLIC_NAME, 1, 10); assertEquals(triggerEvents, fetched); verify(provider).getTriggers(1, 10); }