I would like to create a matcher that takes async or non-async callback, sets up some listeners, invokes callback, verifies listeners received expected events, and then clean up listeners.
However, I see couple blockers:
- The method
Matcher.matches
is sync - It seems expectLater is taking result of invocation, so matcher cannot configure listeners
Is it possible at all to create what I want?