@Test public void invokesInitializeMethodWithCustomLifecycleMethodStrategy() throws Exception { LifecycleMethodStrategy lifecycleMethodStrategy = mock(LifecycleMethodStrategy.class); Resource instance = new Resource(); LifecycleComponent lifecycleComponent = new LifecycleComponent(instance, lifecycleMethodStrategy); lifecycleComponent.initialize(); verify(lifecycleMethodStrategy).invokeInitializeMethods(instance); }
public void initialize() { lifecycleStrategy.invokeInitializeMethods(component); }
LifecycleComponent { public void initialize() { lifecycleStrategy.invokeInitializeMethods(component); } }
LifecycleComponent { public void initialize() { lifecycleStrategy.invokeInitializeMethods(component); } LifecycleComponent(Object component);  LifecycleComponent(Object component, LifecycleMethodStrategy lifecycleStrategy); }
LifecycleComponent { public void initialize() { lifecycleStrategy.invokeInitializeMethods(component); } LifecycleComponent(Object component);  LifecycleComponent(Object component, LifecycleMethodStrategy lifecycleStrategy); void initialize(); void destroy(); Object getComponent(); }
LifecycleComponent { public void initialize() { lifecycleStrategy.invokeInitializeMethods(component); } LifecycleComponent(Object component);  LifecycleComponent(Object component, LifecycleMethodStrategy lifecycleStrategy); void initialize(); void destroy(); Object getComponent();  }