mockito for java 17

following up, there are further bugs to fix with the existing implementation with Mockito (somehow the existing codebase used mockito, together with easyMock, PowerMock as well).

The workable versions are :

in addition,

  1. switching from mockito 1 to 2, it now stops matching null with any. so the solution is to wrap it with nullable.

2. another breaking change is, mockito 2 doesn’t match array with any. the solution is to cast with any(Object[].class)

3. Mockito anyCollection().toArray() is no longer matching with array


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s