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

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


        assertEquals("A changed calendar entry location.", changedCalendarEntry.location());
    }

    public void testRescheduleCalendarEntry() throws Exception {

        CalendarEntry calendarEntry = this.calendarEntryAggregate();

        DomainRegistry.calendarEntryRepository().save(calendarEntry);

        Date now = new Date();
        Date nextWeek = new Date(now.getTime() + (86400000L * 7L));
        Date nextWeekAndOneHour = new Date(nextWeek.getTime() + (1000 * 60 * 60));

        calendarEntryApplicationService
            .rescheduleCalendarEntry(
                    calendarEntry.tenant().id(),
                    calendarEntry.calendarEntryId().id(),
                    "A changed description.",
                    "A changed location.",
                    nextWeek,
                    nextWeekAndOneHour,
                    "DoesNotRepeat",
                    nextWeekAndOneHour,
                    "Hours",
                    8);

        CalendarEntry changedCalendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendarEntry.tenant(),
                            calendarEntry.calendarEntryId());

        assertNotNull(changedCalendarEntry);
        assertEquals("A changed description.", changedCalendarEntry.description());
        assertEquals("A changed location.", changedCalendarEntry.location());
        assertEquals(nextWeek, changedCalendarEntry.timeSpan().begins());
        assertEquals(nextWeekAndOneHour, changedCalendarEntry.timeSpan().ends());
        assertTrue(changedCalendarEntry.repetition().repeats().isDoesNotRepeat());
        assertTrue(changedCalendarEntry.alarm().alarmUnitsType().isHours());
        assertEquals(8, changedCalendarEntry.alarm().alarmUnits());
    }
View Full Code Here


        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());
    }
View Full Code Here

                    "Hours",
                    8,
                    new HashSet<String>(0),
                    result);

        CalendarEntry calendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendar.tenant(),
                            new CalendarEntryId(calendarEntryId));

        assertNotNull(calendarEntry);
        assertEquals("My annual checkup appointment", calendarEntry.description());
        assertEquals("Family Health Offices", calendarEntry.location());
        assertEquals("owner1", calendarEntry.owner().identity());
    }
View Full Code Here

        super();
    }

    public void testCalendarEntryDataOfId() throws Exception {

        CalendarEntry calendarEntry = this.calendarEntryAggregate();

        DomainRegistry.calendarEntryRepository().save(calendarEntry);

        CalendarEntryData calendarEntryData =
                calendarEntryQueryService
                    .calendarEntryDataOfId(
                            calendarEntry.tenant().id(),
                            calendarEntry.calendarEntryId().id());

        assertNotNull(calendarEntryData);
        assertNotNull(calendarEntryData.getAlarmAlarmUnitsType());
        assertNotNull(calendarEntryData.getCalendarEntryId());
        assertNotNull(calendarEntryData.getCalendarId());
        assertEquals(calendarEntry.calendarId().id(), calendarEntryData.getCalendarId());
        assertNotNull(calendarEntryData.getDescription());
        assertNotNull(calendarEntryData.getLocation());
        assertNotNull(calendarEntryData.getOwnerEmailAddress());
        assertNotNull(calendarEntryData.getOwnerIdentity());
        assertNotNull(calendarEntryData.getOwnerName());
        assertNotNull(calendarEntryData.getRepetitionType());
        assertEquals(calendarEntry.tenant().id(), calendarEntryData.getTenantId());
        assertNotNull(calendarEntryData.getInvitees());
        assertTrue(calendarEntryData.getInvitees().isEmpty());
    }
View Full Code Here

        super();
    }

    public void testChangeCalendarEntryDescription() throws Exception {

        CalendarEntry calendarEntry = this.calendarEntryAggregate();

        DomainRegistry.calendarEntryRepository().save(calendarEntry);

        calendarEntryApplicationService
            .changeCalendarEntryDescription(
                    calendarEntry.tenant().id(),
                    calendarEntry.calendarEntryId().id(),
                    "A changed calendar entry description.");

        CalendarEntry changedCalendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendarEntry.tenant(),
                            calendarEntry.calendarEntryId());

        assertNotNull(changedCalendarEntry);
        assertEquals("A changed calendar entry description.", changedCalendarEntry.description());
    }
View Full Code Here

        assertEquals("A changed calendar entry description.", changedCalendarEntry.description());
    }

    public void testInviteCalendarEntryParticipant() 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);

        CalendarEntry changedCalendarEntry =
                DomainRegistry
                    .calendarEntryRepository()
                    .calendarEntryOfId(
                            calendarEntry.tenant(),
                            calendarEntry.calendarEntryId());

        assertNotNull(changedCalendarEntry);
        assertEquals(3, changedCalendarEntry.allInvitees().size());

        for (Participant invitee : changedCalendarEntry.allInvitees()) {
            assertTrue(invitee.identity().equals("participant1") ||
                       invitee.identity().equals("participant2") ||
                       invitee.identity().equals("participant3"));
        }
    }
View Full Code Here

TOP

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

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.