thymeleaf-testing
thymeleaf-testing copied to clipboard
Support for custom template modes
Currently it is not possible to use a custom template mode in the testing framework making it impossible to test your own template modes. It would be nice if we could add them in the same way we can add our own Dialects.
I've made a fork and written a simple solution:
- Added a private list of ITemplateModeHandler
- Added getter and setter for the list
- Added addTemplateModeHandler method to add a single handler for convenience
- during private void execute(final ITestable testable, final TestExecutionContext context) I add all handlers in the list to the TemplateEngine before it is added to the context
I'd be happy to do a pull request but I ran into the following: I wanted to add unit tests for the new code but I couldn't really find where to put them since the tests in https://github.com/thymeleaf/thymeleaf-tests seem to be sorted on functionality instead of package and class.