@Test public void testRunTestNoActiveModule() { doReturn(Optional.empty()).when(workspaceProjectContext).getActiveModule(); presenter.onRunTest(); verify(view, never()).showBusyIndicator(any()); verify(placeManager, never()).goTo(any(PlaceRequest.class)); verify(testRunnerService, never()).runAllTests(anyString(), any()); }
@Override public void onRunTest() { final Optional<Module> activeModule = workspaceProjectContext.getActiveModule(); if (activeModule.isPresent()) { view.showBusyIndicator(ts.getTranslation(LibraryConstants.Testing)); placeManager.goTo(new DefaultPlaceRequest("org.kie.guvnor.TestResults")); testRunnerService.call( (RemoteCallback<Void>) response -> view.hideBusyIndicator() ).runAllTests(user.getIdentifier(), activeModule.get().getRootPath()); } }
ProjectMainActions implements ProjectMainActionsView.Presenter,
                                           IsElement { @Override public void onRunTest() { final Optional<Module> activeModule = workspaceProjectContext.getActiveModule(); if (activeModule.isPresent()) { view.showBusyIndicator(ts.getTranslation(LibraryConstants.Testing)); placeManager.goTo(new DefaultPlaceRequest("org.kie.guvnor.TestResults")); testRunnerService.call( (RemoteCallback<Void>) response -> view.hideBusyIndicator() ).runAllTests(user.getIdentifier(), activeModule.get().getRootPath()); } } }
ProjectMainActions implements ProjectMainActionsView.Presenter,
                                           IsElement { @Override public void onRunTest() { final Optional<Module> activeModule = workspaceProjectContext.getActiveModule(); if (activeModule.isPresent()) { view.showBusyIndicator(ts.getTranslation(LibraryConstants.Testing)); placeManager.goTo(new DefaultPlaceRequest("org.kie.guvnor.TestResults")); testRunnerService.call( (RemoteCallback<Void>) response -> view.hideBusyIndicator() ).runAllTests(user.getIdentifier(), activeModule.get().getRootPath()); } } @Inject  ProjectMainActions(final BuildExecutor buildExecutor,
                              final ProjectMainActionsView view,
                              final Caller<TestRunnerService> testRunnerService,
                              final WorkspaceProjectContext workspaceProjectContext,
                              final PlaceManager placeManager,
                              final TranslationService ts,
                              final User user); }
ProjectMainActions implements ProjectMainActionsView.Presenter,
                                           IsElement { @Override public void onRunTest() { final Optional<Module> activeModule = workspaceProjectContext.getActiveModule(); if (activeModule.isPresent()) { view.showBusyIndicator(ts.getTranslation(LibraryConstants.Testing)); placeManager.goTo(new DefaultPlaceRequest("org.kie.guvnor.TestResults")); testRunnerService.call( (RemoteCallback<Void>) response -> view.hideBusyIndicator() ).runAllTests(user.getIdentifier(), activeModule.get().getRootPath()); } } @Inject  ProjectMainActions(final BuildExecutor buildExecutor,
                              final ProjectMainActionsView view,
                              final Caller<TestRunnerService> testRunnerService,
                              final WorkspaceProjectContext workspaceProjectContext,
                              final PlaceManager placeManager,
                              final TranslationService ts,
                              final User user); @PostConstruct void init(); void setBuildEnabled(boolean buildEnabled); void setDeployEnabled(boolean deployEnabled); void setRedeployEnabled(boolean redeployEnabled); void setViewDeploymentDetailsEnabled(boolean viewDeploymentDetailsEnabled); @Override void triggerBuild(); @Override void triggerBuildAndInstall(); @Override void triggerBuildAndDeploy(); @Override void triggerRedeploy(); @Override void onRunTest(); @Override HTMLElement getElement(); }
ProjectMainActions implements ProjectMainActionsView.Presenter,
                                           IsElement { @Override public void onRunTest() { final Optional<Module> activeModule = workspaceProjectContext.getActiveModule(); if (activeModule.isPresent()) { view.showBusyIndicator(ts.getTranslation(LibraryConstants.Testing)); placeManager.goTo(new DefaultPlaceRequest("org.kie.guvnor.TestResults")); testRunnerService.call( (RemoteCallback<Void>) response -> view.hideBusyIndicator() ).runAllTests(user.getIdentifier(), activeModule.get().getRootPath()); } } @Inject  ProjectMainActions(final BuildExecutor buildExecutor,
                              final ProjectMainActionsView view,
                              final Caller<TestRunnerService> testRunnerService,
                              final WorkspaceProjectContext workspaceProjectContext,
                              final PlaceManager placeManager,
                              final TranslationService ts,
                              final User user); @PostConstruct void init(); void setBuildEnabled(boolean buildEnabled); void setDeployEnabled(boolean deployEnabled); void setRedeployEnabled(boolean redeployEnabled); void setViewDeploymentDetailsEnabled(boolean viewDeploymentDetailsEnabled); @Override void triggerBuild(); @Override void triggerBuildAndInstall(); @Override void triggerBuildAndDeploy(); @Override void triggerRedeploy(); @Override void onRunTest(); @Override HTMLElement getElement();  }