use of org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.validation.impl.ContextModelConstraintsExtractorImpl in project kie-wb-common by kiegroup.
the class AbstractBackendFormRenderingContextManagerTest method initTest.
@Before
public void initTest() {
List<FieldValueProcessor> processors = Arrays.asList(new SubFormFieldValueProcessor(), new MultipleSubFormFieldValueProcessor());
fieldValueProcessors = mock(Instance.class);
when(fieldValueProcessors.iterator()).then(proc -> processors.iterator());
formValuesProcessor = new FormValuesProcessorImpl(fieldValueProcessors);
contextManager = new BackendFormRenderingContextManagerImpl(formValuesProcessor, new ContextModelConstraintsExtractorImpl());
formData = generateFormData();
classLoader = mock(ClassLoader.class);
long timestamp = contextManager.registerContext(getRootForm(), formData, classLoader, getNestedForms()).getTimestamp();
context = contextManager.getContext(timestamp);
assertNotNull("Context cannot be null", context);
}
Also used :
FieldValueProcessor(org.kie.workbench.common.forms.dynamic.service.context.generation.dynamic.FieldValueProcessor)
MultipleSubFormFieldValueProcessor(org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.fieldProcessors.MultipleSubFormFieldValueProcessor)
SubFormFieldValueProcessor(org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.fieldProcessors.SubFormFieldValueProcessor)
Instance(javax.enterprise.inject.Instance)
MultipleSubFormFieldValueProcessor(org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.fieldProcessors.MultipleSubFormFieldValueProcessor)
SubFormFieldValueProcessor(org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.fieldProcessors.SubFormFieldValueProcessor)
ContextModelConstraintsExtractorImpl(org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.validation.impl.ContextModelConstraintsExtractorImpl)
MultipleSubFormFieldValueProcessor(org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.fieldProcessors.MultipleSubFormFieldValueProcessor)
Before(org.junit.Before)