public void testRemovedParticipantNoLongerRetrieved() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake = new ParticipantId("bill@foo.com"); target.addParticipant(fake); target.removeParticipant(fake); assertEquals(Collections.singletonList(creator), CollectionUtils.newArrayList(target.getParticipantIds())); }
public void testRemovedParticipantNoLongerRetrieved() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake = new ParticipantId("bill@foo.com"); target.addParticipant(fake); target.removeParticipant(fake); assertEquals(Collections.singletonList(creator), CollectionUtils.newArrayList(target.getParticipantIds())); }
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); }
conversation.removeParticipant(targetParticipant); participantsRemoved.add(targetParticipant.getAddress());