GetRunningProcessesAction extends AbstractRunnerAction { @Override public void stop() { if (channel == null || processStartedHandler == null) { return; } webSocketUtil.unSubscribeHandler(channel, processStartedHandler); super.stop(); channel = null; processStartedHandler = null; } @Inject  GetRunningProcessesAction(NotificationManager notificationManager,
                                     RunnerServiceClient service,
                                     DtoUnmarshallerFactory dtoUnmarshallerFactory,
                                     AppContext appContext,
                                     RunnerLocalizationConstant locale,
                                     Provider<AsyncCallbackBuilder<List<ApplicationProcessDescriptor>>> callbackBuilderProvider,
                                     WebSocketUtil webSocketUtil,
                                     RunnerActionFactory actionFactory,
                                     RunnerManagerPresenter runnerManagerPresenter,
                                     PropertiesContainer propertiesContainer,
                                     @Named("workspaceId") String workspaceId); @Override void perform(); @Override void stop();  }
@Test public void runnerProcessShouldNotBeStoppedWhenChannelAndProcessStartedHandlerAndStopListenerAreNull() { reset(logsAction); getRunningProcessesAction.stop(); verifyNoMoreInteractions(webSocketUtil, logsAction); }
@Test public void runnerProcessShouldNotBeStoppedWhenChannelIsNullAndProcessStartedHandlerIsNullButStopListenerIsNotNull() { reset(logsAction); getRunningProcessesAction.setListener(listener); getRunningProcessesAction.stop(); verify(listener, never()).onStopAction(); verifyNoMoreInteractions(webSocketUtil, logsAction); }