From 631750b53063b6717e66fbb0da6797a6336408a9 Mon Sep 17 00:00:00 2001 From: Celestino Bellone Date: Sun, 6 Aug 2017 12:22:49 +0200 Subject: [PATCH] #320 - fix test (cherry picked from commit 122edc5) --- .../java/alfio/controller/api/admin/SerializablePair.java | 2 +- .../alfio/controller/ReservationFlowIntegrationTest.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/alfio/controller/api/admin/SerializablePair.java b/src/main/java/alfio/controller/api/admin/SerializablePair.java index 47f5cacb42..15d8a52d77 100644 --- a/src/main/java/alfio/controller/api/admin/SerializablePair.java +++ b/src/main/java/alfio/controller/api/admin/SerializablePair.java @@ -19,7 +19,7 @@ import lombok.experimental.Delegate; import org.apache.commons.lang3.tuple.Pair; -final class SerializablePair { +public final class SerializablePair { @Delegate private final Pair pair; diff --git a/src/test/java/alfio/controller/ReservationFlowIntegrationTest.java b/src/test/java/alfio/controller/ReservationFlowIntegrationTest.java index bd9678ceed..901b5fdd2b 100644 --- a/src/test/java/alfio/controller/ReservationFlowIntegrationTest.java +++ b/src/test/java/alfio/controller/ReservationFlowIntegrationTest.java @@ -23,6 +23,7 @@ import alfio.controller.api.ReservationApiController; import alfio.controller.api.admin.CheckInApiController; import alfio.controller.api.admin.EventApiController; +import alfio.controller.api.admin.SerializablePair; import alfio.controller.api.support.TicketHelper; import alfio.controller.form.PaymentForm; import alfio.controller.form.ReservationForm; @@ -365,9 +366,9 @@ private void checkCSV(String eventName, String ticketIdentifier, String fullName Principal principal = Mockito.mock(Principal.class); Mockito.when(principal.getName()).thenReturn(user); MockHttpServletResponse response = new MockHttpServletResponse(); - List fields = eventApiController.getAllFields(eventName); + List> fields = eventApiController.getAllFields(eventName); MockHttpServletRequest request = new MockHttpServletRequest(); - request.setParameter("fields", fields.toArray(new String[]{})); + request.setParameter("fields", fields.stream().map(SerializablePair::getKey).toArray(String[]::new)); eventApiController.downloadAllTicketsCSV(eventName, request, response, principal); CSVReader csvReader = new CSVReader(new StringReader(response.getContentAsString())); List csv = csvReader.readAll();