Description
For those of us who didn't come from a Java background and hence weren't exposed to Mockito, the Readme section when() dependency stubbing
is maddeningly tantalizing. The obvious question one immediately asks is what if you don't care what the arg values are in the stubbed method? After much web searching and inspection of fflib_ApexMocksTest
I realized there was a whole wealth of matchers that can be used not only in the verify()
but also in the when()
!
A small additional example in the Readme would inspire and direct the reader to the supported matchers in fflib_Match
.
This framework is pretty powerful stuff but as
- the related SFDC andyinthecloud pages are out of date (ref to generating Mocks class) and
- the second edition book has syntax errors (uses
factory()
method instead ofmock()
method) and - the referenced blog posts are sprinkled with pre Stub API ....
Thus, getting the fflib / andyinthecloud online doc up to date / more comprehensive would go a long way towards increased adoption.