@Test public void shouldNotRegisterIfNonTasksModuleBecomesAvailable() { when(bundle.getSymbolicName()).thenReturn("some.other.module"); registerer.addingBundle(bundle, null); verify(bundle).getSymbolicName(); verify(bundleContext, never()).registerService( anyString(), any(SchedulerChannelProvider.class), any(Dictionary.class) ); }
@Override public Object addingBundle(Bundle bundle, BundleEvent bundleEvent) { if (TASKS_BUNDLE_SYMBOLIC_NAME.equals(bundle.getSymbolicName())) { LOGGER.info("Tasks module added, registering SchedulerChannelProvider service"); register(); } return null; }
DynamicChannelProviderRegisterer implements BundleTrackerCustomizer { @Override public Object addingBundle(Bundle bundle, BundleEvent bundleEvent) { if (TASKS_BUNDLE_SYMBOLIC_NAME.equals(bundle.getSymbolicName())) { LOGGER.info("Tasks module added, registering SchedulerChannelProvider service"); register(); } return null; } }
DynamicChannelProviderRegisterer implements BundleTrackerCustomizer { @Override public Object addingBundle(Bundle bundle, BundleEvent bundleEvent) { if (TASKS_BUNDLE_SYMBOLIC_NAME.equals(bundle.getSymbolicName())) { LOGGER.info("Tasks module added, registering SchedulerChannelProvider service"); register(); } return null; }  }
DynamicChannelProviderRegisterer implements BundleTrackerCustomizer { @Override public Object addingBundle(Bundle bundle, BundleEvent bundleEvent) { if (TASKS_BUNDLE_SYMBOLIC_NAME.equals(bundle.getSymbolicName())) { LOGGER.info("Tasks module added, registering SchedulerChannelProvider service"); register(); } return null; }  @PostConstruct void init(); @Override Object addingBundle(Bundle bundle, BundleEvent bundleEvent); @Override void modifiedBundle(Bundle bundle, BundleEvent bundleEvent, Object o); @Override void removedBundle(Bundle bundle, BundleEvent bundleEvent, Object o); }
DynamicChannelProviderRegisterer implements BundleTrackerCustomizer { @Override public Object addingBundle(Bundle bundle, BundleEvent bundleEvent) { if (TASKS_BUNDLE_SYMBOLIC_NAME.equals(bundle.getSymbolicName())) { LOGGER.info("Tasks module added, registering SchedulerChannelProvider service"); register(); } return null; }  @PostConstruct void init(); @Override Object addingBundle(Bundle bundle, BundleEvent bundleEvent); @Override void modifiedBundle(Bundle bundle, BundleEvent bundleEvent, Object o); @Override void removedBundle(Bundle bundle, BundleEvent bundleEvent, Object o);  }