use of org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.marshalling.time.LocalDateFieldValueMarshaller in project kie-wb-common by kiegroup.
the class AbstractBackendFormRenderingContextManagerTest method initTest.
@Before
public void initTest() {
SubFormFieldValueMarshaller subFormFieldValueMarshaller = new SubFormFieldValueMarshaller();
MultipleSubFormFieldValueMarshaller multipleSubFormFieldValueMarshaller = new MultipleSubFormFieldValueMarshaller();
List<FieldValueMarshaller> marshallers = Arrays.asList(subFormFieldValueMarshaller, multipleSubFormFieldValueMarshaller, new DateMultipleInputFieldValueMarshaller(), new DateMultipleSelectorFieldValueMarshaller(), new LocalDateFieldValueMarshaller(), new TextAreaFormFieldValueMarshaller(), new StringMultipleInputValueMarshaller(), new StringMultipleSelectorValueMarshaller());
marshallersInstance = mock(Instance.class);
when(marshallersInstance.iterator()).then(proc -> marshallers.iterator());
registry = new FieldValueMarshallerRegistryImpl(marshallersInstance);
subFormFieldValueMarshaller.setRegistry(registry);
multipleSubFormFieldValueMarshaller.setRegistry(registry);
contextManager = new BackendFormRenderingContextManagerImpl(registry, 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);
}
Aggregations