@Test public void testGetTrigger() throws Exception { TaskTriggerInformation info = prepareTaskTriggerInformation(); TriggerEvent triggerEvent = prepareTriggerEvent(); when(provider.getTrigger(eq(info))).thenReturn(triggerEvent); TriggerEvent fetched = channelLoader.getTrigger(info); assertEquals(triggerEvent, fetched); verify(provider).getTrigger(eq(info)); }
@Override @Transactional public TriggerEvent getTrigger(TaskTriggerInformation triggerInformation) { DynamicChannelProvider provider = getChannelProvider(triggerInformation.getModuleName()); if (provider != null) { return provider.getTrigger(triggerInformation); } else { LOGGER.debug(PROVIDER_NOT_FOUND, triggerInformation.getModuleName()); } return null; }
DynamicChannelLoaderImpl implements DynamicChannelLoader { @Override @Transactional public TriggerEvent getTrigger(TaskTriggerInformation triggerInformation) { DynamicChannelProvider provider = getChannelProvider(triggerInformation.getModuleName()); if (provider != null) { return provider.getTrigger(triggerInformation); } else { LOGGER.debug(PROVIDER_NOT_FOUND, triggerInformation.getModuleName()); } return null; } }
DynamicChannelLoaderImpl implements DynamicChannelLoader { @Override @Transactional public TriggerEvent getTrigger(TaskTriggerInformation triggerInformation) { DynamicChannelProvider provider = getChannelProvider(triggerInformation.getModuleName()); if (provider != null) { return provider.getTrigger(triggerInformation); } else { LOGGER.debug(PROVIDER_NOT_FOUND, triggerInformation.getModuleName()); } return null; } @Autowired  DynamicChannelLoaderImpl(BundleContext bundleContext); }
DynamicChannelLoaderImpl implements DynamicChannelLoader { @Override @Transactional public TriggerEvent getTrigger(TaskTriggerInformation triggerInformation) { DynamicChannelProvider provider = getChannelProvider(triggerInformation.getModuleName()); if (provider != null) { return provider.getTrigger(triggerInformation); } else { LOGGER.debug(PROVIDER_NOT_FOUND, triggerInformation.getModuleName()); } return null; } @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); }
DynamicChannelLoaderImpl implements DynamicChannelLoader { @Override @Transactional public TriggerEvent getTrigger(TaskTriggerInformation triggerInformation) { DynamicChannelProvider provider = getChannelProvider(triggerInformation.getModuleName()); if (provider != null) { return provider.getTrigger(triggerInformation); } else { LOGGER.debug(PROVIDER_NOT_FOUND, triggerInformation.getModuleName()); } return null; } @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);  }