ScenarioSimulationKogitoCreationPopupView extends AbstractScenarioPopupView implements ScenarioSimulationKogitoCreationPopup { protected void enableCreateButtonForDMNScenario() { if (selectedPath != null && !selectedPath.isEmpty()) { okButton.setEnabled(true); } }  @Override void show(String mainTitleText, Command okCommand); @Override ScenarioSimulationModel.Type getSelectedType(); @Override String getSelectedPath(); @EventHandler("dmn-button") void onDmnClick(final ClickEvent event); @EventHandler("rule-button") void onRuleClick(final ClickEvent event);  }
@Test public void enableCreateButtonForDMNScenarioNullPath() { scenarioSimulationCreationPopupViewSpy.enableCreateButtonForDMNScenario(); verify(okButtonMock, never()).setEnabled(anyBoolean()); }
@Test public void enableCreateButtonForDMNScenarioEmptyPath() { scenarioSimulationCreationPopupViewSpy.selectedPath = ""; scenarioSimulationCreationPopupViewSpy.enableCreateButtonForDMNScenario(); verify(okButtonMock, never()).setEnabled(anyBoolean()); }
@Test public void enableCreateButtonForDMNScenarioWithPath() { scenarioSimulationCreationPopupViewSpy.selectedPath = "Path"; scenarioSimulationCreationPopupViewSpy.enableCreateButtonForDMNScenario(); verify(okButtonMock, times(1)).setEnabled(eq(true)); }