use of org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel in project kie-wb-common by kiegroup.
the class FormDefinitionGeneratorImplTest method testGenerateAllForms.
@Test
public void testGenerateAllForms() {
generator.generateAllForms(diagram);
verify(generator, times(4)).createFormForModel(formModelArgumentCaptor.capture(), any());
verify(formDefinitionSerializer, times(4)).serialize(formDefinitionArgumentCaptor.capture());
verify(ioService, times(1)).startBatch(any());
verify(ioService, times(1)).getFileSystem(any());
verify(ioService, times(4)).createFile(any());
verify(ioService, times(4)).write(any(), anyString());
verify(ioService, times(1)).endBatch();
List<JBPMFormModel> formModels = formModelArgumentCaptor.getAllValues();
List<FormDefinition> forms = formDefinitionArgumentCaptor.getAllValues();
Assertions.assertThat(formModels).isNotEmpty().hasSize(forms.size()).hasSize(4);
for (int i = 0; i < formModels.size(); i++) {
JBPMFormModel formModel = formModels.get(i);
FormDefinition form = forms.get(i);
if (formModel instanceof BusinessProcessFormModel) {
checkProcessFormGenerated((BusinessProcessFormModel) formModel, form);
} else {
TaskFormModel taskFormModel = (TaskFormModel) formModel;
checkTaskFormGenerated(taskFormModel, taskFormModel.getTaskName(), form);
}
}
}
Aggregations