How to write gunits for form inference classes

58 views Asked by At

While trying to write gunits for form inference classes, getting the below error while setting the context. How can I achieve it?

Error screenshot

1

There are 1 answers

0
Abhijay Kumar On

There's a compilation error since the constructor is protected and not intended to be used outside the forms package or a subclass. I don't think you need to initialize FormInferenceContext by calling the constructor. How about quoting or issuing the submission with the appropriate availability conditions and then checking the existence of the form using something like

policyPeriod.Forms.hasMatch(\f -> f.FormPatternCode == "ABCD")

You can then write an assert on whether the form is found (available) or not. Reproducing or mimicking what happens in FormInferenceEngine is not required for GUnits.