public void testParticipantChangesFireEvents() { ParticipantId p1 = new ParticipantId("someone@example.com"); ParticipantId p2 = new ParticipantId("else@example.com"); ObservableConversation mirror = mirrorConversation(target); mirror.addListener(convListener); target.addParticipant(p1); target.addParticipant(p2); verify(convListener).onParticipantAdded(p1); verify(convListener).onParticipantAdded(p2); target.addParticipant(p1); verifyNoMoreInteractions(convListener); target.removeParticipant(p2); verify(convListener).onParticipantRemoved(p2); }
public void testParticipantChangesFireEvents() { ParticipantId p1 = new ParticipantId("someone@example.com"); ParticipantId p2 = new ParticipantId("else@example.com"); ObservableConversation mirror = mirrorConversation(target); mirror.addListener(convListener); target.addParticipant(p1); target.addParticipant(p2); verify(convListener).onParticipantAdded(p1); verify(convListener).onParticipantAdded(p2); target.addParticipant(p1); verifyNoMoreInteractions(convListener); target.removeParticipant(p2); verify(convListener).onParticipantRemoved(p2); }
private void triggerOnParticipantAdded(ParticipantId participant) { for (Listener l : listeners) { l.onParticipantAdded(participant); } }