use of org.drools.workbench.screens.scenariosimulation.client.events.UpdateSettingsDataEvent in project drools-wb by kiegroup.
the class SettingsPresenter method syncDmoSession.
@Override
public void syncDmoSession() {
String dmoSession = getCleanValue(() -> view.getDmoSession().getValue());
eventBus.fireEvent(new UpdateSettingsDataEvent(settingsToUpdate -> settingsToUpdate.setDmoSession(dmoSession), settingsToCheck -> !Objects.equals(settingsToCheck.getDmoSession(), dmoSession)));
}
use of org.drools.workbench.screens.scenariosimulation.client.events.UpdateSettingsDataEvent in project drools-wb by kiegroup.
the class SettingsPresenter method syncRuleFlowGroup.
@Override
public void syncRuleFlowGroup() {
String ruleFlow = getCleanValue(() -> view.getRuleFlowGroup().getValue());
eventBus.fireEvent(new UpdateSettingsDataEvent(settingsToUpdate -> settingsToUpdate.setRuleFlowGroup(ruleFlow), settingsToCheck -> !Objects.equals(settingsToCheck.getRuleFlowGroup(), ruleFlow)));
}
use of org.drools.workbench.screens.scenariosimulation.client.events.UpdateSettingsDataEvent in project drools-wb by kiegroup.
the class ScenarioSimulationEventHandlerTest method onUpdateSettingDataEventNoChangedValue.
@Test
public void onUpdateSettingDataEventNoChangedValue() {
Predicate<Settings> predicateMock = mock(Predicate.class);
when(predicateMock.test(eq(settingsLocal))).thenReturn(false);
Consumer<Settings> consumerMock = mock(Consumer.class);
UpdateSettingsDataEvent event = new UpdateSettingsDataEvent(consumerMock, predicateMock);
scenarioSimulationEventHandler.onEvent(event);
verify(predicateMock, times(1)).test(eq(settingsLocal));
verify(scenarioSimulationEventHandler, never()).commonExecution(isA(UpdateSettingsDataCommand.class), eq(false));
verify(scenarioSimulationEditorPresenterMock, never()).unpublishTestResultsAlerts();
}
Aggregations