I have a simple update method in my manager class and I need to verify if event was fired.
public void editUser(User user) {
entityManager.merge(user);
entityManager.flush();
updateEvent.fire(new UserEvent(user));
}
Usually i would do that through the verify method but in this case event.fire() is called with new instance of UserEvent as its parameter.
verify(event).fire(new UserEvent(user));
This will fail because event was fired with different instance of UserEvent inside the manager. Is there a way to verify this method call?
The easiest way is to use
any(Class<T>):