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); }
public void testAddedParticipantIsRetreived() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake = new ParticipantId("bill@foo.com"); target.addParticipant(fake); assertEquals(Arrays.asList(creator, fake), CollectionUtils.newArrayList(target.getParticipantIds())); }
public void testAddedParticipantIsRetreived() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake = new ParticipantId("bill@foo.com"); target.addParticipant(fake); assertEquals(Arrays.asList(creator, fake), CollectionUtils.newArrayList(target.getParticipantIds())); }
public void testParticipantsAreASet() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake1 = new ParticipantId("joe"); ParticipantId fake2 = new ParticipantId("bill"); List<ParticipantId> participants = CollectionUtils.newArrayList(creator, fake1, fake2); target.addParticipant(fake1); target.addParticipant(fake2); assertEquals(participants, CollectionUtils.newArrayList(target.getParticipantIds())); target.addParticipant(fake2); assertEquals(participants, CollectionUtils.newArrayList(target.getParticipantIds())); }
public void testParticipantsAreASet() { ParticipantId creator = target.getParticipantIds().iterator().next(); ParticipantId fake1 = new ParticipantId("joe"); ParticipantId fake2 = new ParticipantId("bill"); List<ParticipantId> participants = CollectionUtils.newArrayList(creator, fake1, fake2); target.addParticipant(fake1); target.addParticipant(fake2); assertEquals(participants, CollectionUtils.newArrayList(target.getParticipantIds())); target.addParticipant(fake2); assertEquals(participants, 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 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())); }
conversation.addParticipant(targetParticipant); participantsAdded.add(targetParticipant.getAddress()); event =