assertEquals(8, changedCalendarEntry.alarm().alarmUnits());
}
public void testUninviteCalendarEntryParticipant() throws Exception {
CalendarEntry calendarEntry = this.calendarEntryAggregate();
DomainRegistry.calendarEntryRepository().save(calendarEntry);
Set<String> invitees = new HashSet<String>(0);
invitees.add("participant1");
invitees.add("participant2");
invitees.add("participant3");
calendarEntryApplicationService
.inviteCalendarEntryParticipant(
calendarEntry.tenant().id(),
calendarEntry.calendarEntryId().id(),
invitees);
Set<String> uninvitees = new HashSet<String>(invitees);
assertTrue(uninvitees.remove("participant2"));
calendarEntryApplicationService
.uninviteCalendarEntryParticipant(
calendarEntry.tenant().id(),
calendarEntry.calendarEntryId().id(),
uninvitees);
CalendarEntry changedCalendarEntry =
DomainRegistry
.calendarEntryRepository()
.calendarEntryOfId(
calendarEntry.tenant(),
calendarEntry.calendarEntryId());
assertNotNull(changedCalendarEntry);
assertEquals(1, changedCalendarEntry.allInvitees().size());
assertEquals("participant2", changedCalendarEntry.allInvitees().iterator().next().identity());
}