I have an EventBus that is posted as below
EventBus bus = EventBus.getDefault();
bus.post(new MyEvent("mystring", json));
I wanted to perform a unit test to ensure this bus has called a post function, with the MyEvent Object.
EventBus bus = mock(EventBus.class);
verify(bus).post(isA(MyEvent.class));
The above code works well. However, I also wanted to ensure "mystring" is passed to the MyEvent object during the instantiation. How could I achieve that?
Aucun commentaire:
Enregistrer un commentaire