DynamicChannelLoaderImpl implements DynamicChannelLoader { @Override public boolean validateTrigger(String moduleName, String subject) { DynamicChannelProvider provider = getChannelProvider(moduleName); return provider.validateSubject(subject); } @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 testValidateTrigger() throws Exception { when(provider.validateSubject(eq(SUBJECT_ONE))).thenReturn(true); assertTrue(channelLoader.validateTrigger(MODULE_SYMBOLIC_NAME, SUBJECT_ONE)); verify(provider).validateSubject(eq(SUBJECT_ONE)); }