use of org.kie.workbench.common.forms.data.modeller.service.ext.ModelReader in project kie-wb-common by kiegroup.
the class ModuleDMOModelReaderServiceTest method testReadModels.
private void testReadModels(Function<ModelReader, Collection<DataObjectFormModel>> formula) {
ModelReader modelReader = resolveModelReader();
Assertions.assertThat(modelReader).isNotNull();
Collection<DataObjectFormModel> models = formula.apply(modelReader);
Assertions.assertThat(models).isNotNull().hasSize(3);
Optional<DataObjectFormModel> clientModel = findModel(models, CLIENT_TYPE);
assertTrue(clientModel.isPresent());
validateClientModel(clientModel.get(), Source.INTERNAL);
Optional<DataObjectFormModel> lineModel = findModel(models, LINE_TYPE);
assertTrue(lineModel.isPresent());
validateLineModel(lineModel.get(), Source.INTERNAL);
Optional<DataObjectFormModel> expenseModel = findModel(models, EXPENSE_TYPE);
assertTrue(expenseModel.isPresent());
validateExpenseModel(expenseModel.get(), Source.INTERNAL);
}
use of org.kie.workbench.common.forms.data.modeller.service.ext.ModelReader in project kie-wb-common by kiegroup.
the class AbstractDMOModelReaderServiceTest method launchSingleModelTest.
protected void launchSingleModelTest(Consumer<ModelReader> modelReaderConsumer) {
ModelReader modelReader = resolveModelReader();
Assertions.assertThat(modelReader).isNotNull();
modelReaderConsumer.accept(modelReader);
}
use of org.kie.workbench.common.forms.data.modeller.service.ext.ModelReader in project kie-wb-common by kiegroup.
the class ModuleDMOModelReaderServiceDependentModulesTest method testReadModuleModels.
@Test
public void testReadModuleModels() {
ModelReader modelReader = resolveModelReader();
Collection<DataObjectFormModel> models = modelReader.readModuleFormModels();
Assertions.assertThat(models).isNotNull().hasSize(1);
Optional<DataObjectFormModel> addressModel = findModel(models, ADDRESS_TYPE);
assertTrue(addressModel.isPresent());
validateAddressModel(addressModel.get(), Source.INTERNAL);
}
use of org.kie.workbench.common.forms.data.modeller.service.ext.ModelReader in project kie-wb-common by kiegroup.
the class ModuleDMOModelReaderServiceDependentModulesTest method testReadAllModels.
@Test
public void testReadAllModels() {
ModelReader modelReader = resolveModelReader();
Collection<DataObjectFormModel> models = modelReader.readAllFormModels();
Assertions.assertThat(models).isNotNull().hasSize(4);
Optional<DataObjectFormModel> addressModel = findModel(models, ADDRESS_TYPE);
assertTrue(addressModel.isPresent());
validateAddressModel(addressModel.get(), Source.INTERNAL);
Optional<DataObjectFormModel> clientModel = findModel(models, CLIENT_TYPE);
assertTrue(clientModel.isPresent());
validateClientModel(clientModel.get(), Source.EXTERNAL);
Optional<DataObjectFormModel> lineModel = findModel(models, LINE_TYPE);
assertTrue(lineModel.isPresent());
validateLineModel(lineModel.get(), Source.EXTERNAL);
Optional<DataObjectFormModel> expenseModel = findModel(models, EXPENSE_TYPE);
assertTrue(expenseModel.isPresent());
validateExpenseModel(expenseModel.get(), Source.EXTERNAL);
}
use of org.kie.workbench.common.forms.data.modeller.service.ext.ModelReader in project kie-wb-common by kiegroup.
the class NestedFormsBPMNRuntimeFormDefinitionGeneratorServiceTest method setup.
@Override
public void setup() {
when(modelReaderService.getModelReader(any())).thenAnswer((Answer<ModelReader>) invocationOnMock -> new RuntimeDMOModelReader((ClassLoader) invocationOnMock.getArguments()[0], new RawMVELEvaluator()));
super.setup();
}
Aggregations