use of org.kie.workbench.common.forms.processing.engine.handling.ModelValidator in project kie-wb-common by kiegroup.
the class FormValidatorImplTest method testModelAndFieldStateValidatorsCalled.
private void testModelAndFieldStateValidatorsCalled(boolean modelSuccess, boolean fieldStateSuccess) {
ModelValidator modelValidator = mock(ModelValidator.class);
when(modelValidator.validate(anyCollection(), any())).thenReturn(modelSuccess);
when(fieldStateValidator.validate(anyCollection())).thenReturn(fieldStateSuccess);
formValidator.setModelValidator(modelValidator);
assertEquals(formValidator.validate(form, model), modelSuccess && fieldStateSuccess);
verify(fieldStateValidator).validate(form.getFields());
verify(modelValidator).validate(form.getFields(), model);
}
use of org.kie.workbench.common.forms.processing.engine.handling.ModelValidator in project kie-wb-common by kiegroup.
the class FormValidatorImplTest method testSetModelValidator.
@Test
public void testSetModelValidator() {
ModelValidator modelValidator = mock(ModelValidator.class);
formValidator.setModelValidator(modelValidator);
assertSame(formValidator.getModelValidator(), modelValidator);
}
Aggregations