hprange / wounit

The WOUnit framework contains a set of utilities for testing WebObjects applications using JUnit 4.7 or later capabilities.
http://hprange.github.io/wounit/
Apache License 2.0
19 stars 18 forks source link

Spy and Mock of EO, dummies or other WO classes does not works under Mockito 5.x #60

Open spelletier opened 3 weeks ago

spelletier commented 3 weeks ago

By default Mockito 5.x use a new MockMaker that is not compatible with any WO subclasses. It is still possible to create mock and spy by specifying the old MockMaker like this:

I suggest to adjust the wounits behaviour when detecting @Spy annotation to specify the old MockMaker and creating a new @EOMock (or WOMock) annotation to help creating compatible mock with the old MockMaker.

spelletier commented 3 weeks ago

I have a local working version with the @Spy fix but the MockMakers is new and require Mockito 4.8.

I experience no problems using Mockito 4.x. Maybe we can upgrade the Mockito dependency to 4.8 and adjust code to be compatible with 5.x.

I has to adjust some test code to remove warnings and some error, especially in assert call that changed style.