@Test void testNothingIsRegisteredForNullComponent(@Mock Configuration configuration) { LifecycleHandlerInspector.registerLifecycleHandlers(configuration, null); verifyZeroInteractions(configuration); }
public static void registerLifecycleHandlers(Configuration configuration, Object component) { if (component == null) { logger.debug("Ignoring [null] component for inspection as it wont participate in the lifecycle"); return; } registerLifecycleHandlers(configuration, component, StartHandler.class, Configuration::onStart); registerLifecycleHandlers(configuration, component, ShutdownHandler.class, Configuration::onShutdown); }
LifecycleHandlerInspector { public static void registerLifecycleHandlers(Configuration configuration, Object component) { if (component == null) { logger.debug("Ignoring [null] component for inspection as it wont participate in the lifecycle"); return; } registerLifecycleHandlers(configuration, component, StartHandler.class, Configuration::onStart); registerLifecycleHandlers(configuration, component, ShutdownHandler.class, Configuration::onShutdown); } }
LifecycleHandlerInspector { public static void registerLifecycleHandlers(Configuration configuration, Object component) { if (component == null) { logger.debug("Ignoring [null] component for inspection as it wont participate in the lifecycle"); return; } registerLifecycleHandlers(configuration, component, StartHandler.class, Configuration::onStart); registerLifecycleHandlers(configuration, component, ShutdownHandler.class, Configuration::onShutdown); } private  LifecycleHandlerInspector(); }
LifecycleHandlerInspector { public static void registerLifecycleHandlers(Configuration configuration, Object component) { if (component == null) { logger.debug("Ignoring [null] component for inspection as it wont participate in the lifecycle"); return; } registerLifecycleHandlers(configuration, component, StartHandler.class, Configuration::onStart); registerLifecycleHandlers(configuration, component, ShutdownHandler.class, Configuration::onShutdown); } private  LifecycleHandlerInspector(); static void registerLifecycleHandlers(Configuration configuration, Object component); }
LifecycleHandlerInspector { public static void registerLifecycleHandlers(Configuration configuration, Object component) { if (component == null) { logger.debug("Ignoring [null] component for inspection as it wont participate in the lifecycle"); return; } registerLifecycleHandlers(configuration, component, StartHandler.class, Configuration::onStart); registerLifecycleHandlers(configuration, component, ShutdownHandler.class, Configuration::onShutdown); } private  LifecycleHandlerInspector(); static void registerLifecycleHandlers(Configuration configuration, Object component);  }