Examples of UserTicket


Examples of in.partake.model.dto.UserTicket

    @Test
    public void testShouldChangeToPresence() throws Exception {
        //
        {
            UserTicket enrollment = loadEnrollment(TestDataProvider.ATTENDANCE_ABSENT_USER_ID, TestDataProvider.DEFAULT_EVENT_TICKET_ID);
            Assert.assertEquals(AttendanceStatus.ABSENT, enrollment.getAttendanceStatus());
        }

        ActionProxy proxy = getActionProxy(POST, API_EVENT_ATTEND_URL);
        loginAs(proxy, TestDataProvider.EVENT_OWNER_ID);

        addFormParameter(proxy, "userId", TestDataProvider.ATTENDANCE_ABSENT_USER_ID);
        addFormParameter(proxy, "ticketId", TestDataProvider.DEFAULT_EVENT_TICKET_ID.toString());
        addFormParameter(proxy, "status", "present");
        addValidSessionTokenToParameter(proxy);

        proxy.execute();
        assertResultOK(proxy);

        // Check status is changed.
        {
            UserTicket enrollment = loadEnrollment(TestDataProvider.ATTENDANCE_ABSENT_USER_ID, TestDataProvider.DEFAULT_EVENT_TICKET_ID);
            Assert.assertEquals(AttendanceStatus.PRESENT, enrollment.getAttendanceStatus());
        }
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

    @Test
    public void testShouldChangeToAbsence() throws Exception {
        //
        {
            UserTicket enrollment = loadEnrollment(TestDataProvider.ATTENDANCE_UNKNOWN_USER_ID, TestDataProvider.DEFAULT_EVENT_TICKET_ID);
            Assert.assertEquals(AttendanceStatus.UNKNOWN, enrollment.getAttendanceStatus());
        }

        ActionProxy proxy = getActionProxy(POST, API_EVENT_ATTEND_URL);
        loginAs(proxy, TestDataProvider.EVENT_OWNER_ID);

        addFormParameter(proxy, "userId", ATTENDANCE_UNKNOWN_USER_ID);
        addFormParameter(proxy, "ticketId", DEFAULT_EVENT_TICKET_ID.toString());
        addFormParameter(proxy, "status", "absent");
        addValidSessionTokenToParameter(proxy);

        proxy.execute();
        assertResultOK(proxy);

        // Check status is changed.
        {
            UserTicket enrollment = loadEnrollment(ATTENDANCE_UNKNOWN_USER_ID, DEFAULT_EVENT_TICKET_ID);
            Assert.assertEquals(AttendanceStatus.ABSENT, enrollment.getAttendanceStatus());
        }
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

    @Test
    public void testShouldChangeToUnknown() throws Exception {
        //
        {
            UserTicket enrollment = loadEnrollment(TestDataProvider.ATTENDANCE_PRESENT_USER_ID, TestDataProvider.DEFAULT_EVENT_TICKET_ID);
            Assert.assertEquals(AttendanceStatus.PRESENT, enrollment.getAttendanceStatus());
        }

        ActionProxy proxy = getActionProxy(POST, API_EVENT_ATTEND_URL);
        loginAs(proxy, TestDataProvider.EVENT_OWNER_ID);

        addFormParameter(proxy, "userId", TestDataProvider.ATTENDANCE_PRESENT_USER_ID);
        addFormParameter(proxy, "ticketId", TestDataProvider.DEFAULT_EVENT_TICKET_ID.toString());
        addFormParameter(proxy, "status", "unknown");
        addValidSessionTokenToParameter(proxy);

        proxy.execute();
        assertResultOK(proxy);

        // Check status is changed.
        {
            UserTicket enrollment = loadEnrollment(TestDataProvider.ATTENDANCE_PRESENT_USER_ID, TestDataProvider.DEFAULT_EVENT_TICKET_ID);
            Assert.assertEquals(AttendanceStatus.UNKNOWN, enrollment.getAttendanceStatus());
        }
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

public class UserTicketTestDataProvider extends TestDataProvider<UserTicket> {

    @Override
    public UserTicket create(long pkNumber, String pkSalt, int objNumber) {
        UUID uuid = new UUID(pkNumber, pkSalt.hashCode());
        return new UserTicket(uuid.toString(), "userId" + objNumber, DEFAULT_EVENT_TICKET_ID, DEFAULT_EVENT_ID, "comment", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(0L), null);
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

    }

    @Override
    public List<UserTicket> createSamples() {
        List<UserTicket> array = new ArrayList<UserTicket>();
        array.add(new UserTicket("id", "userId", new UUID(0, 0), "comment", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(0L), null));
        array.add(new UserTicket("id1", "userId", new UUID(0, 0), "comment", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(0L), null));
        array.add(new UserTicket("id", "userId1", new UUID(0, 0), "comment", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(0L), null));
        array.add(new UserTicket("id", "userId", new UUID(0, 1), "comment", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(0L), null));
        array.add(new UserTicket("id", "userId", new UUID(0, 0), "comment1", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(0L), null));
        array.add(new UserTicket("id", "userId", new UUID(0, 0), "comment1", "eventId", ParticipationStatus.RESERVED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(0L), null));
        array.add(new UserTicket("id", "userId", new UUID(0, 0), "comment", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(0L), null));
        array.add(new UserTicket("id", "userId", new UUID(0, 0), "comment", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.ABSENT, null, new DateTime(0L), new DateTime(0L), null));
        array.add(new UserTicket("id", "userId", new UUID(0, 0), "comment", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(1L), new DateTime(0L), null));
        array.add(new UserTicket("id", "userId", new UUID(0, 0), "comment", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(1L), null));
        array.add(new UserTicket("id", "userId", new UUID(0, 0), "comment", "eventId", ParticipationStatus.ENROLLED, ModificationStatus.ENROLLED, AttendanceStatus.PRESENT, null, new DateTime(0L), new DateTime(0L), new DateTime(0L)));
        return array;
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

    public void createFixtures(PartakeConnection con, IPartakeDAOs daos) throws DAOException {
        IUserTicketAccess dao = daos.getEnrollmentAccess();

        dao.truncate(con);
        dao.put(con, new UserTicket(UUID.randomUUID().toString(),
                EVENT_ENROLLED_USER_ID, DEFAULT_EVENT_TICKET_ID, DEFAULT_EVENT_ID, "comment", ParticipationStatus.ENROLLED,
                ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime(), null));
        dao.put(con, new UserTicket(UUID.randomUUID().toString(),
                EVENT_RESERVED_USER_ID, DEFAULT_EVENT_TICKET_ID, DEFAULT_EVENT_ID, "comment", ParticipationStatus.RESERVED,
                ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime(), null));
        dao.put(con, new UserTicket(UUID.randomUUID().toString(),
                EVENT_CANCELLED_USER_ID, DEFAULT_EVENT_TICKET_ID, DEFAULT_EVENT_ID, "comment", ParticipationStatus.CANCELLED,
                ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime(), null));

        dao.put(con, new UserTicket(UUID.randomUUID().toString(),
                ATTENDANCE_PRESENT_USER_ID, DEFAULT_EVENT_TICKET_ID, DEFAULT_EVENT_ID, "comment", ParticipationStatus.ENROLLED,
                ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime(), null));
        dao.put(con, new UserTicket(UUID.randomUUID().toString(),
                ATTENDANCE_ABSENT_USER_ID, DEFAULT_EVENT_TICKET_ID, DEFAULT_EVENT_ID, "comment", ParticipationStatus.ENROLLED,
                ModificationStatus.CHANGED, AttendanceStatus.ABSENT, null, TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime(), null));
        dao.put(con, new UserTicket(UUID.randomUUID().toString(),
                ATTENDANCE_UNKNOWN_USER_ID, DEFAULT_EVENT_TICKET_ID, DEFAULT_EVENT_ID, "comment", ParticipationStatus.ENROLLED,
                ModificationStatus.CHANGED, AttendanceStatus.UNKNOWN, null, TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime(), null));

        // Enrollment for private event
        dao.put(con, new UserTicket(UUID.randomUUID().toString(),
                EVENT_ENROLLED_USER_ID, PRIVATE_EVENT_TICKET_ID, DEFAULT_EVENT_ID, "comment", ParticipationStatus.ENROLLED,
                ModificationStatus.CHANGED, AttendanceStatus.PRESENT, null, TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime(), null));
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

            String eventId = ids.get(i).getSecond();
            ParticipationStatus status = ParticipationStatus.ENROLLED;
            ModificationStatus modificationStatus = ModificationStatus.CHANGED;
            AttendanceStatus attendanceStatus = AttendanceStatus.UNKNOWN;
            DateTime enrolledAt = new DateTime(TimeUtil.getCurrentTime() + (ids.size() - i) * 1000);
            UserTicket enrollment = new UserTicket(null, userId, ticketId, eventId, "comment", status, modificationStatus, attendanceStatus, null, enrolledAt, enrolledAt, enrolledAt);
            userTicketIds.add(storeEnrollment(enrollment));
        }
        return userTicketIds;
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

        addValidSessionTokenToParameter(proxy);

        proxy.execute();
        assertResultOK(proxy);

        UserTicket enrollment = loadEnrollment(DEFAULT_USER_ID, DEFAULT_EVENT_TICKET_ID);
        assertThat(enrollment.getStatus(), is(ParticipationStatus.ENROLLED));
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

        addValidSessionTokenToParameter(proxy);

        proxy.execute();
        assertResultOK(proxy);

        UserTicket enrollment = loadEnrollment(DEFAULT_USER_ID, DEFAULT_EVENT_TICKET_ID);
        assertThat(enrollment.getStatus(), is(ParticipationStatus.RESERVED));
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

        addValidSessionTokenToParameter(proxy);

        proxy.execute();
        assertResultOK(proxy);

        UserTicket enrollment = loadEnrollment(DEFAULT_USER_ID, DEFAULT_EVENT_TICKET_ID);
        assertThat(enrollment.getStatus(), is(ParticipationStatus.CANCELLED));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.