BusinessGroupSendToChooserFormUIModel { public ContactMessage getContactMessage() { return contactMessage; } BusinessGroupSendToChooserFormUIModel(Identity fromIdentity, GroupParameter ownerGroup, GroupParameter participantGroup, GroupParameter waitingList); ContactMessage getContactMessage();  }
@Test public void shouldCreateAContactMessageWithThreeContactlists() { BusinessGroupSendToChooserFormUIModel sendToChooserFormUIModel = new BusinessGroupSendToChooserFormUIModel(peterBichselAsFromIdentity, ownerGroup, participantGroup, waitingList); ContactMessage contactMessage = sendToChooserFormUIModel.getContactMessage(); List<ContactList> emailToContactLists = contactMessage.getEmailToContactLists(); verifyContactListFor(ownerContactListName, ownerGroupList, emailToContactLists); verifyContactListFor(participantContactListName, participantGroupList, emailToContactLists); verifyContactListFor(waitingContactListName, waitingGroupList, emailToContactLists); verifyBasicContactMessageParts(contactMessage); }
@Test public void shouldCreateAContactMessageWithTwoContactlists() { waitingList = null; BusinessGroupSendToChooserFormUIModel sendToChooserFormUIModel = new BusinessGroupSendToChooserFormUIModel(peterBichselAsFromIdentity, ownerGroup, participantGroup, waitingList); ContactMessage contactMessage = sendToChooserFormUIModel.getContactMessage(); List<ContactList> emailToContactLists = contactMessage.getEmailToContactLists(); verifyContactListFor(ownerContactListName, ownerGroupList, emailToContactLists); verifyContactListFor(participantContactListName, participantGroupList, emailToContactLists); verifyBasicContactMessageParts(contactMessage); assertTrue("Contact Message has at least one address", contactMessage.hasAtLeastOneAddress()); }
@Test public void shouldCreateAContactMessageWithOneContactlists() { participantGroup = null; waitingList = null; BusinessGroupSendToChooserFormUIModel sendToChooserFormUIModel = new BusinessGroupSendToChooserFormUIModel(peterBichselAsFromIdentity, ownerGroup, participantGroup, waitingList); ContactMessage contactMessage = sendToChooserFormUIModel.getContactMessage(); List<ContactList> emailToContactLists = contactMessage.getEmailToContactLists(); verifyContactListFor(ownerContactListName, ownerGroupList, emailToContactLists); verifyBasicContactMessageParts(contactMessage); assertTrue("Contact Message has at least one address", contactMessage.hasAtLeastOneAddress()); }
@Test public void shouldCreateAContactMessageWithNoContactlists() { ownerGroup = null; participantGroup = null; waitingList = null; BusinessGroupSendToChooserFormUIModel sendToChooserFormUIModel = new BusinessGroupSendToChooserFormUIModel(peterBichselAsFromIdentity, ownerGroup, participantGroup, waitingList); ContactMessage contactMessage = sendToChooserFormUIModel.getContactMessage(); verifyBasicContactMessageParts(contactMessage); boolean noAddresses = !contactMessage.hasAtLeastOneAddress(); assertTrue("Contact Message has not one address", noAddresses); }