AbstractRunnerActions extends ProjectAction { @Override protected void updateProjectAction(ActionEvent event) { CurrentProject currentProject = appContext.getCurrentProject(); event.getPresentation().setEnabledAndVisible(currentProject != null); } AbstractRunnerActions(@NotNull AppContext appContext,
                                 @NotNull String actionName,
                                 @NotNull String actionPrompt,
                                 @Nullable SVGResource image);   }
@Test public void actionShouldBeUpdatedWhenCurrentProjectIsNotNull() throws Exception { when(appContext.getCurrentProject()).thenReturn(currentProject); action.updateProjectAction(actionEvent); verify(appContext).getCurrentProject(); verify(actionEvent.getPresentation()).setEnabledAndVisible(true); }
@Test public void actionShouldBeUpdatedWhenCurrentProjectIsNull() throws Exception { when(appContext.getCurrentProject()).thenReturn(null); action.updateProjectAction(actionEvent); verify(appContext).getCurrentProject(); verify(actionEvent.getPresentation()).setEnabledAndVisible(false); }