RunnerWidget implements RunnerItems<Runner> { public void setDelegate(@NotNull ActionDelegate delegate) { this.delegate = delegate; } @Inject  RunnerWidget(ItemWidget itemWidget,
                        RunnerResources resources,
                        PartStackUIResources buttonIcons,
                        final SelectionManager selectionManager); @Override void select(); @Override void unSelect(); @Override void update(@NotNull Runner runner); @Override Widget asWidget(); void setDelegate(@NotNull ActionDelegate delegate);  }
@Test public void prepareActionShouldBePerformed() { ArgumentCaptor<ItemWidget.ActionDelegate> actionDelegateCaptor = ArgumentCaptor.forClass(ItemWidget.ActionDelegate.class); verify(resources).runnerInProgress(); verify(resources).runnerInQueue(); verify(resources).runnerFailed(); verify(resources).runnerTimeout(); verify(resources, times(2)).runnerDone(); verify(itemWidget).getImagePanel(); verify(buttonIcons).erase(); verify(itemWidget).setDelegate(actionDelegateCaptor.capture()); ItemWidget.ActionDelegate actionDelegate = actionDelegateCaptor.getValue(); actionDelegate.onWidgetClicked(); verify(selectionManager).setRunner(any(Runner.class)); }