use of org.drools.workbench.screens.scenariosimulation.client.events.UpdateSettingsDataEvent in project drools-wb by kiegroup.
the class ScenarioSimulationEventHandlerTest method onUpdateSettingDataEventChangedValue.
@Test
public void onUpdateSettingDataEventChangedValue() {
Predicate<Settings> predicateMock = mock(Predicate.class);
when(predicateMock.test(eq(settingsLocal))).thenReturn(true);
Consumer<Settings> consumerMock = mock(Consumer.class);
UpdateSettingsDataEvent event = new UpdateSettingsDataEvent(consumerMock, predicateMock);
scenarioSimulationEventHandler.onEvent(event);
verify(predicateMock, times(1)).test(eq(settingsLocal));
verify(scenarioSimulationEventHandler, times(1)).commonExecution(isA(UpdateSettingsDataCommand.class), eq(false));
verify(scenarioSimulationEditorPresenterMock, times(1)).unpublishTestResultsAlerts();
}
use of org.drools.workbench.screens.scenariosimulation.client.events.UpdateSettingsDataEvent in project drools-wb by kiegroup.
the class ScenarioSimulationEventHandlerTest method onUpdateSettingDataEventNoChangedValueTest.
@Test
public void onUpdateSettingDataEventNoChangedValueTest() {
Consumer<Settings> consumerMock = mock(Consumer.class);
UpdateSettingsDataEvent event = new UpdateSettingsDataEvent(consumerMock);
scenarioSimulationEventHandler.onEvent(event);
verify(scenarioSimulationEventHandler, times(1)).commonExecution(isA(UpdateSettingsDataCommand.class), eq(false));
verify(scenarioSimulationEditorPresenterMock, times(1)).unpublishTestResultsAlerts();
}
use of org.drools.workbench.screens.scenariosimulation.client.events.UpdateSettingsDataEvent in project drools-wb by kiegroup.
the class SettingsPresenter method syncDmnFilePath.
@Override
public void syncDmnFilePath() {
String dmnFilePath = getCleanValue(() -> settingsScenarioSimulationDropdown.getValue().map(KieAssetsDropdownItem::getValue).orElse(""));
eventBus.fireEvent(new UpdateSettingsDataEvent(settingsToUpdate -> settingsToUpdate.setDmnFilePath(dmnFilePath), settingsToCheck -> !Objects.equals(settingsToCheck.getDmnFilePath(), dmnFilePath), true));
}
use of org.drools.workbench.screens.scenariosimulation.client.events.UpdateSettingsDataEvent in project drools-wb by kiegroup.
the class SettingsPresenter method syncStateless.
@Override
public void syncStateless() {
boolean isStateless = view.getStateless().isChecked();
eventBus.fireEvent(new UpdateSettingsDataEvent(settingsToUpdate -> settingsToUpdate.setStateless(isStateless)));
}
use of org.drools.workbench.screens.scenariosimulation.client.events.UpdateSettingsDataEvent in project drools-wb by kiegroup.
the class SettingsPresenter method syncSkipFromBuild.
@Override
public void syncSkipFromBuild() {
boolean isSkipFromBuild = view.getSkipFromBuild().isChecked();
eventBus.fireEvent(new UpdateSettingsDataEvent(settingsToUpdate -> settingsToUpdate.setSkipFromBuild(isSkipFromBuild)));
}
Aggregations