Hello,

Two PRs have been created to address this ticket - please see comments in
jira.

The first PR is mostly a documentation change as it turned out the required
functionality already existed.

The second PR introduces some unit testing, but to be able to test
MacroFormRenderer without an explosion of mockito mocks, and lots of
careful setup in the environment, which would lead to brittle tests, I felt
it appropriate to introduce JMockit.

How does the development community feel about the trade-off of introducing
another test library versus the ability to create tests without a massive
amount of, in my opinion, brittle code.

Possibly the preferred approach would have been to apply some refactoring
to MacroFormRender to allow easier testing. Specifically MFR could be split
into two or more classes to:
- convert from the field type to the rendered FTL macro string
- execute a rendered FTL macro string

The refactoring is probably preferable in the long run, but felt too large
a task for this particular ticket.

What do you think? Can we permit the JMockit tests until some refactoring
is carried out?

Thanks,

Dan.

-- 
Daniel Watford

Reply via email to