Package in.partake.model.dto

Examples of in.partake.model.dto.Event


    public void testChangedToEnrolled() throws Exception {
        truncate();

        DateTime now = TimeUtil.getCurrentDateTime();

        Event event = PartakeTestApp.getTestService().getTestDataProviderSet().getEventProvider().create();
        event.setOwnerId(EVENT_OWNER_ID);
        event.setBeginDate(now.nHourAfter(48));
        storeEvent(event);

        UUID ticketId = UUID.randomUUID();
        EventTicket ticket = EventTicket.createDefaultTicket(ticketId, event.getId());
        storeEventTicket(ticket);

        String[] enrollmentIds = new String[] { UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), };

        UserTicket[] enrollments = new UserTicket[] {
                new UserTicket(enrollmentIds[0], DEFAULT_USER_IDS[0], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.NOT_ENROLLED, AttendanceStatus.PRESENT, null, now, now, null),
                new UserTicket(enrollmentIds[1], DEFAULT_USER_IDS[1], ticketId, event.getId(), "comment", ParticipationStatus.RESERVED,
                        ModificationStatus.NOT_ENROLLED, AttendanceStatus.PRESENT, null, now, now, null),
                new UserTicket(enrollmentIds[2], DEFAULT_USER_IDS[2], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, now, now, null)
        };

        for (UserTicket enrollment : enrollments)
            storeEnrollment(enrollment);
View Full Code Here


    public void testChangedToCancelled() throws Exception {
        truncate();

        DateTime now = TimeUtil.getCurrentDateTime();

        Event event = PartakeTestApp.getTestService().getTestDataProviderSet().getEventProvider().create();
        event.setOwnerId(EVENT_OWNER_ID);
        event.setBeginDate(now.nHourAfter(48));
        storeEvent(event);

        UUID ticketId = UUID.randomUUID();
        EventTicket ticket = EventTicket.createDefaultTicket(ticketId, event.getId());
        ticket.setAmount(1);
        ticket.setAmountType(TicketAmountType.LIMITED);
        storeEventTicket(ticket);

        String[] enrollmentIds = new String[] {
                UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(),
        };

        UserTicket[] enrollments = new UserTicket[] {
                new UserTicket(enrollmentIds[0], DEFAULT_USER_IDS[0], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, now, now, null),
                new UserTicket(enrollmentIds[1], DEFAULT_USER_IDS[1], ticketId, event.getId(), "comment", ParticipationStatus.RESERVED,
                        ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(now.getTime() + 1), now, null),
                new UserTicket(enrollmentIds[2], DEFAULT_USER_IDS[2], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(now.getTime() + 2), now, null),
                new UserTicket(enrollmentIds[3], DEFAULT_USER_IDS[3], ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                        ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, new DateTime(now.getTime() + 3), now, null)
        };

        for (UserTicket enrollment : enrollments)
            storeEnrollment(enrollment);
View Full Code Here

    @Test
    public void sendReminder() throws Exception {
        truncate();

        DateTime now = TimeUtil.getCurrentDateTime();
        Event event = PartakeTestApp.getTestService().getTestDataProviderSet().getEventProvider().create();
        event.setOwnerId(DEFAULT_USER_ID);
        event.setBeginDate(now.nHourAfter(12));
        storeEvent(event);

        UUID ticketId = UUID.randomUUID();
        EventTicket ticket = EventTicket.createDefaultTicket(ticketId, event.getId());
        storeEventTicket(ticket);

        String id = UUID.randomUUID().toString();
        UserTicket enrollment = new UserTicket(id, DEFAULT_USER_ID, ticketId, event.getId(), "comment", ParticipationStatus.ENROLLED,
                ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, now, now, now);
        storeEnrollment(enrollment);

        // This event should be reminded.
        new EventReminderTask().run();
View Full Code Here

                Set<String> eventIds = new HashSet<String>();

                for (int i = 0; i < 10; ++i) {
                    String eventId;

                    Event original = createEvent(null, userId);
                    {
                        con.beginTransaction();
                        eventId = dao.getFreshId(con);
                        original.setId(eventId);

                        dao.put(con, original);
                        con.commit();

                        eventIds.add(eventId);
View Full Code Here

                Set<String> eventIds = new HashSet<String>();

                for (int i = 0; i < 10; ++i) {
                    String eventId;

                    Event original = createEvent(null, userId);
                    {
                        con.beginTransaction();
                        eventId = dao.getFreshId(con);
                        original.setId(eventId);

                        dao.put(con, original);
                        con.commit();

                        eventIds.add(eventId);
View Full Code Here

        }.execute();
    }

    private Event createEvent(String eventId, String userId) {
        EventTestDataProvider provider = PartakeTestApp.getTestService().getTestDataProviderSet().getEventProvider();
        Event event = provider.create();

        event.setId(eventId);
        event.setOwnerId(userId);

        return event;
    }
View Full Code Here

    // ----------------------------------------------------------------------

    @Test
    public void testToBuildUserNotificationMessageBodyForOnedayBeforeReminder() throws Exception{
        UserNotification notification = loadUserNotification(USER_NOTIFICATION_INQUEUE_ID);
        Event event = loadEvent(DEFAULT_EVENT_ID);
        EventTicket ticket = loadEventTicket(DEFAULT_EVENT_TICKET_ID);

        UserNotification userNotification = new UserNotification(notification);
        userNotification.setNotificationType(NotificationType.EVENT_ONEDAY_BEFORE_REMINDER);

        String messageBody = SendMessageEnvelopeTask.buildUserNotificationMessageBody(userNotification, event, ticket);
        String expected = String.format("[PRTK] 「title」は%sに開始です。あなたの参加は確定しています。 http://127.0.0.1:9000/events/00000000-0000-0002-0000-000000000000", Helper.readableDate(event.getBeginDate()));
        assertThat(messageBody, is(expected));
    }
View Full Code Here

    }

    @Test
    public void testToBuildUserNotificationMessageBodyForOnedayBeforeReservationReminder() throws Exception{
        UserNotification notification = loadUserNotification(USER_NOTIFICATION_INQUEUE_ID);
        Event event = loadEvent(DEFAULT_EVENT_ID);
        EventTicket ticket = loadEventTicket(DEFAULT_EVENT_TICKET_ID);

        UserNotification userNotification = new UserNotification(notification);
        userNotification.setNotificationType(NotificationType.ONE_DAY_BEFORE_REMINDER_FOR_RESERVATION);

        String messageBody = SendMessageEnvelopeTask.buildUserNotificationMessageBody(userNotification, event, ticket);
        String expected = String.format("[PRTK] 「title」の締め切りは%sです。参加・不参加を確定してください。 http://127.0.0.1:9000/events/00000000-0000-0002-0000-000000000000", Helper.readableDate(event.getBeginDate()));
        assertThat(messageBody, is(expected));
    }
View Full Code Here

    }

    @Test
    public void testToBuildUserNotificationMessageBodyForHalfdayBeforeReservationReminder() throws Exception{
        UserNotification notification = loadUserNotification(USER_NOTIFICATION_INQUEUE_ID);
        Event event = loadEvent(DEFAULT_EVENT_ID);
        EventTicket ticket = loadEventTicket(DEFAULT_EVENT_TICKET_ID);

        UserNotification userNotification = new UserNotification(notification);
        userNotification.setNotificationType(NotificationType.HALF_DAY_BEFORE_REMINDER_FOR_RESERVATION);

        String messageBody = SendMessageEnvelopeTask.buildUserNotificationMessageBody(userNotification, event, ticket);
        String expected = String.format("[PRTK] 「title」の締め切りは%sです。参加・不参加を確定してください。 http://127.0.0.1:9000/events/00000000-0000-0002-0000-000000000000", Helper.readableDate(event.getBeginDate()));
        assertThat(messageBody, is(expected));
    }
View Full Code Here

    }

    @Test
    public void testToBuildUserNotificationMessageBodyForEnrolledReminder() throws Exception{
        UserNotification notification = loadUserNotification(USER_NOTIFICATION_INQUEUE_ID);
        Event event = loadEvent(DEFAULT_EVENT_ID);
        EventTicket ticket = loadEventTicket(DEFAULT_EVENT_TICKET_ID);

        UserNotification userNotification = new UserNotification(notification);
        userNotification.setNotificationType(NotificationType.BECAME_TO_BE_ENROLLED);
View Full Code Here

TOP

Related Classes of in.partake.model.dto.Event

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.