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);