-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -393,9 +393,9 @@ public void reservationFlowTest() throws Exception { | |
contactForm.setLastName("name"); | ||
|
||
var ticketForm = new UpdateTicketOwnerForm(); | ||
ticketForm.setFirstName("full"); | ||
ticketForm.setLastName("name"); | ||
ticketForm.setEmail("test@test.com"); | ||
ticketForm.setFirstName("ticketfull"); | ||
ticketForm.setLastName("ticketname"); | ||
ticketForm.setEmail("tickettest@test.com"); | ||
contactForm.setTickets(Collections.singletonMap(reservation.getTicketsByCategory().get(0).getTickets().get(0).getUuid(), ticketForm)); | ||
|
||
var overviewRes = reservationApiV2Controller.validateToOverview(event.getShortName(), reservationId, "en", contactForm, new BeanPropertyBindingResult(contactForm, "paymentForm"), new MockHttpServletRequest(), new RedirectAttributesModelMap()); | ||
|
@@ -441,6 +441,53 @@ public void reservationFlowTest() throws Exception { | |
reservation = reservationApiV2Controller.getReservationInfo(event.getShortName(), reservationId, new MockHttpSession()).getBody(); | ||
orderSummary = reservation.getOrderSummary(); | ||
assertFalse(orderSummary.getNotYetPaid()); | ||
|
||
|
||
var confRes = reservationApiV2Controller.reSendReservationConfirmationEmail(event.getShortName(), reservationId, new MockHttpServletRequest()); | ||
assertEquals(HttpStatus.OK, confRes.getStatusCode()); | ||
assertTrue(confRes.getBody()); | ||
|
||
var ticket = reservation.getTicketsByCategory().stream().findFirst().get().getTickets().get(0); | ||
assertEquals("[email protected]", ticket.getEmail()); | ||
assertEquals("ticketfull", ticket.getFirstName()); | ||
assertEquals("ticketname", ticket.getLastName()); | ||
|
||
var ticketNotFoundRes = ticketApiV2Controller.getTicketInfo(event.getShortName(), "DONT_EXISTS"); | ||
assertEquals(HttpStatus.NOT_FOUND, ticketNotFoundRes.getStatusCode()); | ||
|
||
var ticketFoundRes = ticketApiV2Controller.getTicketInfo(event.getShortName(), ticket.getUuid()); | ||
assertEquals(HttpStatus.OK, ticketFoundRes.getStatusCode()); | ||
var ticketFoundBody = ticketFoundRes.getBody(); | ||
assertEquals("[email protected]", ticketFoundBody.getEmail()); | ||
assertEquals("ticketfull ticketname", ticketFoundBody.getFullName()); | ||
assertEquals("full name", ticketFoundBody.getReservationFullName()); | ||
assertTrue(reservationId.startsWith(ticketFoundBody.getReservationId().toLowerCase(Locale.ENGLISH))); | ||
|
||
var sendTicketByEmailRes = ticketApiV2Controller.sendTicketByEmail(event.getShortName(), ticket.getUuid(), new MockHttpServletRequest()); | ||
assertEquals(HttpStatus.OK, sendTicketByEmailRes.getStatusCode()); | ||
assertTrue(sendTicketByEmailRes.getBody()); | ||
|
||
//update ticket | ||
var updateTicketOwnerForm = new UpdateTicketOwnerForm(); | ||
updateTicketOwnerForm.setFirstName("Test"); | ||
updateTicketOwnerForm.setLastName("Testson"); | ||
updateTicketOwnerForm.setEmail("[email protected]"); | ||
var updateTicketRes = ticketApiV2Controller.updateTicketInfo(event.getShortName(), ticket.getUuid(), updateTicketOwnerForm, new BeanPropertyBindingResult(updateTicketOwnerForm, "ticket"), new MockHttpServletRequest(), null); | ||
assertTrue(updateTicketRes.isSuccess()); | ||
|
||
|
||
ticketFoundRes = ticketApiV2Controller.getTicketInfo(event.getShortName(), ticket.getUuid()); | ||
ticketFoundBody = ticketFoundRes.getBody(); | ||
assertEquals("[email protected]", ticketFoundBody.getEmail()); | ||
assertEquals("Test Testson", ticketFoundBody.getFullName()); | ||
assertEquals("full name", ticketFoundBody.getReservationFullName()); | ||
reservation = reservationApiV2Controller.getReservationInfo(event.getShortName(), reservationId, new MockHttpSession()).getBody(); | ||
ticket = reservation.getTicketsByCategory().stream().findFirst().get().getTickets().get(0); | ||
assertEquals("[email protected]", ticket.getEmail()); | ||
assertEquals("Test", ticket.getFirstName()); | ||
assertEquals("Testson", ticket.getLastName()); | ||
|
||
|
||
} | ||
|
||
} | ||
|