Package com.saasovation.collaboration.domain.model.calendar

Examples of com.saasovation.collaboration.domain.model.calendar.CalendarSharer


        for (String participatnId : aParticipantsToSharedWith) {
            Participant participant =
                    this.collaboratorService().participantFrom(aTenant, participatnId);

            sharers.add(new CalendarSharer(participant));
        }

        return sharers;
    }
View Full Code Here


    protected Calendar[] calendarAggregates() {

        Tenant tenant = new Tenant("01234567");

        Set<CalendarSharer> invitees = new TreeSet<CalendarSharer>();
        invitees.add(new CalendarSharer(new Participant("zoe", "Zoe Doe", "zoe@saasovation.com")));

        Calendar calendar1 =
                new Calendar(
                        tenant,
                        DomainRegistry.calendarRepository().nextIdentity(),
View Full Code Here

    }

    public void testQueryCalendar() throws Exception {
        Calendar calendar = this.calendarAggregate();

        CalendarSharer sharerZoe = new CalendarSharer(
                new Participant("zoe", "Zoe Doe", "zoe@saasovation.com"));

        calendar.shareCalendarWith(sharerZoe);

        CalendarSharer sharerJoe = new CalendarSharer(
                new Participant("joe", "Joe Smith", "joe@saasovation.com"));

        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());
            } else {
                assertEquals(calendar.calendarId().id(), sharer.getCalendarId());
                assertEquals(sharerJoe.participant().emailAddress(), sharer.getParticipantEmailAddress());
                assertEquals(sharerJoe.participant().identity(), sharer.getParticipantIdentity());
                assertEquals(sharerJoe.participant().name(), sharer.getParticipantName());
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.saasovation.collaboration.domain.model.calendar.CalendarSharer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.