calendar.shareCalendarWith(sharerJoe);
DomainRegistry.calendarRepository().save(calendar);
CalendarData calendarData =
calendarQueryService.calendarDataOfId(
calendar.tenant().id(),
calendar.calendarId().id());
assertNotNull(calendarData);
assertEquals(calendar.calendarId().id(), calendarData.getCalendarId());
assertEquals(calendar.description(), calendarData.getDescription());
assertEquals(calendar.name(), calendarData.getName());
assertEquals(calendar.owner().emailAddress(), calendarData.getOwnerEmailAddress());
assertEquals(calendar.owner().identity(), calendarData.getOwnerIdentity());
assertEquals(calendar.owner().name(), calendarData.getOwnerName());
assertEquals(calendar.tenant().id(), calendarData.getTenantId());
assertNotNull(calendarData.getSharers());
assertFalse(calendarData.getSharers().isEmpty());
assertEquals(2, calendarData.getSharers().size());
for (CalendarSharerData sharer : calendarData.getSharers()) {
if (sharer.getParticipantIdentity().equals("zoe")) {
assertEquals(calendar.calendarId().id(), sharer.getCalendarId());
assertEquals(sharerZoe.participant().emailAddress(), sharer.getParticipantEmailAddress());
assertEquals(sharerZoe.participant().identity(), sharer.getParticipantIdentity());
assertEquals(sharerZoe.participant().name(), sharer.getParticipantName());