use of org.drools.workbench.screens.scenariosimulation.model.FactMappingValidationError in project drools-wb by kiegroup.
the class ScenarioSimulationEditorPresenterTest method getValidationCallback.
@Test
public void getValidationCallback() {
presenterSpy.getValidationCallback().callback(null);
verify(confirmPopupPresenterMock, never()).show(anyString(), anyString());
List<FactMappingValidationError> validationErrors = new ArrayList<>();
presenterSpy.getValidationCallback().callback(validationErrors);
verify(confirmPopupPresenterMock, never()).show(anyString(), anyString());
String errorMessage = "errorMessage";
String errorId = "errorId";
String errorId2 = "errorId2";
validationErrors.add(new FactMappingValidationError(errorId, errorMessage));
validationErrors.add(new FactMappingValidationError("errorId2", ScenarioSimulationI18nServerMessage.SCENARIO_VALIDATION_NODE_CHANGED_ERROR, "p1", "p2"));
presenterSpy.getValidationCallback().callback(validationErrors);
verify(confirmPopupPresenterMock, times(1)).show(anyString(), contains(errorId));
verify(confirmPopupPresenterMock, times(1)).show(anyString(), contains(errorMessage));
verify(confirmPopupPresenterMock, times(1)).show(anyString(), contains(errorId2));
verify(confirmPopupPresenterMock, times(1)).show(anyString(), contains(ScenarioSimulationEditorConstants.INSTANCE.scenarioValidationNodeChangedError("p1", "p2")));
}
use of org.drools.workbench.screens.scenariosimulation.model.FactMappingValidationError in project drools-wb by kiegroup.
the class ScenarioSimulationEditorI18nServerManagerTest method retrieveMessageFieldRemovedConstraint.
@Test
public void retrieveMessageFieldRemovedConstraint() {
FactMappingValidationError error = FactMappingValidationError.createFieldRemovedConstraintError(factMapping);
String message = ScenarioSimulationEditorI18nServerManager.retrieveMessage(error);
String expected = ScenarioSimulationEditorConstants.INSTANCE.scenarioValidationFieldRemovedConstraintError();
assertEquals(expected, message);
}
use of org.drools.workbench.screens.scenariosimulation.model.FactMappingValidationError in project drools-wb by kiegroup.
the class ScenarioSimulationEditorI18nServerManagerTest method retrieveMessageNodeChangedError.
@Test
public void retrieveMessageNodeChangedError() {
String newType = "newType";
FactMappingValidationError error = FactMappingValidationError.createNodeChangedError(factMapping, newType);
String message = ScenarioSimulationEditorI18nServerManager.retrieveMessage(error);
String expected = ScenarioSimulationEditorConstants.INSTANCE.scenarioValidationNodeChangedError("tMYTYPE", newType);
assertEquals(expected, message);
}
use of org.drools.workbench.screens.scenariosimulation.model.FactMappingValidationError in project drools-wb by kiegroup.
the class ScenarioSimulationEditorI18nServerManagerTest method retrieveMessageFieldAddedConstraint.
@Test
public void retrieveMessageFieldAddedConstraint() {
FactMappingValidationError error = FactMappingValidationError.createFieldAddedConstraintError(factMapping);
String message = ScenarioSimulationEditorI18nServerManager.retrieveMessage(error);
String expected = ScenarioSimulationEditorConstants.INSTANCE.scenarioValidationFieldAddedConstraintError();
assertEquals(expected, message);
}
Aggregations