Skip to content

Commit

Permalink
fix integration test #588
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Jun 10, 2019
1 parent c964fbd commit b67e0a7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,16 @@ public void reservationFlowTest() throws Exception {
ticketForm.setEmail("tickettest@test.com");
contactForm.setTickets(Collections.singletonMap(reservation.getTicketsByCategory().get(0).getTickets().get(0).getUuid(), ticketForm));

var overviewResFailed = reservationApiV2Controller.validateToOverview(event.getShortName(), reservationId, "en", contactForm, new BeanPropertyBindingResult(contactForm, "paymentForm"), new MockHttpServletRequest(), new RedirectAttributesModelMap());
assertEquals(HttpStatus.UNPROCESSABLE_ENTITY, overviewResFailed.getStatusCode());
checkStatus(reservationId, HttpStatus.OK, false, TicketReservation.TicketReservationStatus.PENDING);

//add mandatory additional field
ticketForm.setAdditional(Collections.singletonMap("field1", Collections.singletonList("value")));
var overviewRes = reservationApiV2Controller.validateToOverview(event.getShortName(), reservationId, "en", contactForm, new BeanPropertyBindingResult(contactForm, "paymentForm"), new MockHttpServletRequest(), new RedirectAttributesModelMap());
assertEquals(HttpStatus.OK, overviewRes.getStatusCode());
checkStatus(reservationId, HttpStatus.OK, true, TicketReservation.TicketReservationStatus.PENDING);
//

reservationApiV2Controller.backToBook(event.getShortName(), reservationId);

Expand Down Expand Up @@ -511,6 +518,7 @@ public void reservationFlowTest() throws Exception {
updateTicketOwnerForm.setFirstName("Test");
updateTicketOwnerForm.setLastName("Testson");
updateTicketOwnerForm.setEmail("testmctest@test.com");
updateTicketOwnerForm.setAdditional(Collections.singletonMap("field1", Collections.singletonList("value")));
var updateTicketRes = ticketApiV2Controller.updateTicketInfo(event.getShortName(), ticket.getUuid(), updateTicketOwnerForm, new BeanPropertyBindingResult(updateTicketOwnerForm, "ticket"), new MockHttpServletRequest(), null);
assertTrue(updateTicketRes.isSuccess());

Expand Down

0 comments on commit b67e0a7

Please sign in to comment.