Examples of UserTicket


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));
        assertThat(enrollment.getComment(), is(""));
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

        addFormParameter(proxy, "status", "enroll");
        addFormParameter(proxy, "ticketId", DEFAULT_EVENT_TICKET_ID.toString());
        addFormParameter(proxy, "comment", "comment");
        addValidSessionTokenToParameter(proxy);

        UserTicket original = loadEnrollment(EVENT_RESERVED_USER_ID, DEFAULT_EVENT_TICKET_ID);

        proxy.execute();
        assertResultOK(proxy);

        UserTicket enrollment = loadEnrollment(EVENT_RESERVED_USER_ID, DEFAULT_EVENT_TICKET_ID);

        assertThat(enrollment.getStatus(), is(ParticipationStatus.ENROLLED));
        assertThat(enrollment.getModifiedAt(), is(original.getModifiedAt()));
    }
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 enrolleAt = new DateTime(TimeUtil.getCurrentTime() + (ids.size() - i) * 1000);
            UserTicket enrollment = new UserTicket(null, userId, ticketId, eventId, "comment", status, modificationStatus, attendanceStatus, null, enrolleAt, enrolleAt, enrolleAt);
            userTicketIds.add(storeEnrollment(enrollment));
        }
        return userTicketIds;
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

        addFormParameter(proxy, "userId", EVENT_ENROLLED_USER_ID);
        addValidSessionTokenToParameter(proxy);

        loginAs(proxy, EVENT_OWNER_ID);

        UserTicket enrollment = loadEnrollment(EVENT_ENROLLED_USER_ID, DEFAULT_EVENT_TICKET_ID);
        assertThat(enrollment.getStatus(), is(ParticipationStatus.ENROLLED));

        proxy.execute();
        assertResultOK(proxy);

        enrollment = loadEnrollment(EVENT_ENROLLED_USER_ID, DEFAULT_EVENT_TICKET_ID);
View Full Code Here

Examples of in.partake.model.dto.UserTicket

        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

Examples of in.partake.model.dto.UserTicket

        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

Examples of in.partake.model.dto.UserTicket

        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

Examples of in.partake.model.dto.UserTicket

        super.setup(PartakeApp.getDBService().getDAOs().getEnrollmentAccess());
    }

    @Override
    protected UserTicket create(long pkNumber, String pkSalt, int objNumber) {
        return new UserTicket(
                new UUID(("id" + pkSalt).hashCode(), pkNumber).toString(),
                "userId" + pkSalt + pkNumber,
                new UUID(0, 0),
                "eventId" + pkSalt + pkNumber,
                "comment" + objNumber,
View Full Code Here

Examples of in.partake.model.dto.UserTicket

                String userId = UUID.randomUUID().toString();


                {
                    con.beginTransaction();
                    dao.put(con, new UserTicket(id, userId, ticketId, eventId, "", ParticipationStatus.ENROLLED, ModificationStatus.CHANGED, AttendanceStatus.UNKNOWN, null, TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime(), null));
                    con.commit();
                }

                List<UserTicket> list = dao.findByTicketId(con, ticketId, 0, Integer.MAX_VALUE);

                Assert.assertEquals(1, list.size());
                UserTicket storedParticipation = list.get(0);
                Assert.assertNotNull(storedParticipation);
                Assert.assertEquals(userId, storedParticipation.getUserId());
                Assert.assertEquals(ModificationStatus.CHANGED, storedParticipation.getModificationStatus());
                Assert.assertEquals(status, storedParticipation.getStatus());
                return null;
            }
        }.execute();
    }
View Full Code Here

Examples of in.partake.model.dto.UserTicket

                UUID ticketId = UUID.randomUUID();

                // create
                {
                    con.beginTransaction();
                    dao.put(con, new UserTicket(id,
                            userId, ticketId, eventId,
                            "comment", ParticipationStatus.ENROLLED, ModificationStatus.CHANGED, AttendanceStatus.UNKNOWN, null, TimeUtil.getCurrentDateTime(), TimeUtil.getCurrentDateTime(), null));

                    con.commit();
                }

                // update
                {
                    con.beginTransaction();
                    List<UserTicket> storedList = dao.findByTicketId(con, ticketId, 0, Integer.MAX_VALUE);
                    UserTicket storedParticipation = storedList.get(0);
                    Assert.assertNotNull(storedParticipation);
                    ModificationStatus newStatus = ModificationStatus.NOT_ENROLLED;
                    Assert.assertFalse(newStatus.equals(storedParticipation.getModificationStatus()));
                    UserTicket newStoredParticipation = new UserTicket(storedParticipation);
                    newStoredParticipation.setModificationStatus(ModificationStatus.CHANGED);
                    dao.put(con, newStoredParticipation);
                    con.commit();
                }

                // get
                {
                    con.beginTransaction();
                    List<UserTicket> updatedList = dao.findByTicketId(con, ticketId, 0, Integer.MAX_VALUE);
                    Assert.assertEquals(1, updatedList.size());
                    UserTicket updatedParticipation = updatedList.get(0);
                    Assert.assertEquals(userId, updatedParticipation.getUserId());
                    Assert.assertEquals(ModificationStatus.CHANGED, updatedParticipation.getModificationStatus());
                    Assert.assertEquals(ParticipationStatus.ENROLLED, updatedParticipation.getStatus());
                    con.commit();
                }

                return null;
            }
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.