I recently wrote a special dialect for Thymeleaf along with a custom processor to process some custom tags, and in some cases replaced them with different ones, but I had problems writing tests for the processor:
Class AbstractProcessor
requires overriding
protected ProcessorResult doProcess(Arguments arguments, ProcessorMatchingContext processorMatchingContext, Node node)
which I have to check.
Since my processor involves getting variables from a parameter arguments
, I tried to taunt him; However, classes arguments
, ProcessorMatchingContext
and Node
will announce the final, which means that they can not be the product Mockito.
I really don't want to instantiate the actual object arguments
, since it depends on 5 other objects that cannot be mocked, and I would finish writing tons of code to test only one line in my processor.
Any ideas for a possible testing strategy?
source
share