From da07708ac355b2167608278a0c140844dedddb4c Mon Sep 17 00:00:00 2001 From: Celestino Bellone Date: Sun, 17 Jan 2016 23:16:29 +0100 Subject: [PATCH] sponsor scanning API improvements --- .../controller/api/AttendeeApiController.java | 22 +++++++++-- .../api/admin/CheckInApiController.java | 2 +- .../java/alfio/manager/AttendeeManager.java | 37 +++++++++++++++---- .../java/alfio/manager/CheckInManager.java | 35 +++--------------- .../alfio/manager/support/CheckInResult.java | 21 +++++++++++ .../alfio/manager/support/CheckInStatus.java | 21 +++++++++++ .../manager/support/DefaultCheckInResult.java | 25 +++++++++++++ .../manager/support/OnSitePaymentResult.java | 29 +++++++++++++++ .../support/TicketAndCheckInResult.java | 26 +++++++++++++ .../repository/SponsorScanRepository.java | 8 ++-- .../HSQLDB/V14_1.7.1__ALTER_SPONSOR_SCAN.sql | 18 +++++++++ .../MYSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql | 18 +++++++++ .../PGSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql | 18 +++++++++ .../ReservationFlowIntegrationTest.java | 19 ++++------ 14 files changed, 242 insertions(+), 57 deletions(-) create mode 100644 src/main/java/alfio/manager/support/CheckInResult.java create mode 100644 src/main/java/alfio/manager/support/CheckInStatus.java create mode 100644 src/main/java/alfio/manager/support/DefaultCheckInResult.java create mode 100644 src/main/java/alfio/manager/support/OnSitePaymentResult.java create mode 100644 src/main/java/alfio/manager/support/TicketAndCheckInResult.java create mode 100644 src/main/resources/alfio/db/HSQLDB/V14_1.7.1__ALTER_SPONSOR_SCAN.sql create mode 100644 src/main/resources/alfio/db/MYSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql create mode 100644 src/main/resources/alfio/db/PGSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql diff --git a/src/main/java/alfio/controller/api/AttendeeApiController.java b/src/main/java/alfio/controller/api/AttendeeApiController.java index bd06f786b0..49ff069d80 100644 --- a/src/main/java/alfio/controller/api/AttendeeApiController.java +++ b/src/main/java/alfio/controller/api/AttendeeApiController.java @@ -17,6 +17,10 @@ package alfio.controller.api; import alfio.manager.AttendeeManager; +import alfio.manager.support.TicketAndCheckInResult; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataIntegrityViolationException; @@ -24,7 +28,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import java.time.ZonedDateTime; +import java.security.Principal; @RestController @RequestMapping("/api/attendees") @@ -52,8 +56,20 @@ public ResponseEntity handleGenericException(RuntimeException e) { @RequestMapping(value = "/sponsor-scan", method = RequestMethod.POST) - public ResponseEntity scanBadge(@RequestParam("eventId") int eventId, @RequestParam("ticketIdentifier") String ticketIdentifier) { - return attendeeManager.registerSponsorScan(eventId, ticketIdentifier).map(z -> new ResponseEntity<>(z, HttpStatus.CONFLICT)).orElseGet(() -> new ResponseEntity<>(HttpStatus.OK)); + public ResponseEntity scanBadge(@RequestBody SponsorScanRequest request, Principal principal) { + return new ResponseEntity<>(attendeeManager.registerSponsorScan(request.eventName, request.ticketIdentifier, principal.getName()), HttpStatus.OK); + } + + @Getter + public static class SponsorScanRequest { + private final String eventName; + private final String ticketIdentifier; + + @JsonCreator + public SponsorScanRequest(@JsonProperty("eventName") String eventName, @JsonProperty("ticketIdentifier") String ticketIdentifier) { + this.eventName = eventName; + this.ticketIdentifier = ticketIdentifier; + } } } diff --git a/src/main/java/alfio/controller/api/admin/CheckInApiController.java b/src/main/java/alfio/controller/api/admin/CheckInApiController.java index 8bf1133c14..7e1b46c720 100644 --- a/src/main/java/alfio/controller/api/admin/CheckInApiController.java +++ b/src/main/java/alfio/controller/api/admin/CheckInApiController.java @@ -17,7 +17,7 @@ package alfio.controller.api.admin; import alfio.manager.CheckInManager; -import alfio.manager.CheckInManager.TicketAndCheckInResult; +import alfio.manager.support.TicketAndCheckInResult; import alfio.model.FullTicketInfo; import lombok.Data; import lombok.extern.log4j.Log4j2; diff --git a/src/main/java/alfio/manager/AttendeeManager.java b/src/main/java/alfio/manager/AttendeeManager.java index 462c2d5467..a0a4336015 100644 --- a/src/main/java/alfio/manager/AttendeeManager.java +++ b/src/main/java/alfio/manager/AttendeeManager.java @@ -16,11 +16,15 @@ */ package alfio.manager; +import alfio.manager.support.CheckInStatus; +import alfio.manager.support.DefaultCheckInResult; +import alfio.manager.support.TicketAndCheckInResult; import alfio.model.Event; import alfio.model.Ticket; import alfio.repository.EventRepository; import alfio.repository.SponsorScanRepository; import alfio.repository.TicketRepository; +import alfio.repository.user.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -35,22 +39,39 @@ public class AttendeeManager { private final SponsorScanRepository sponsorScanRepository; private final EventRepository eventRepository; private final TicketRepository ticketRepository; + private final UserRepository userRepository; @Autowired - public AttendeeManager(SponsorScanRepository sponsorScanRepository, EventRepository eventRepository, TicketRepository ticketRepository) { + public AttendeeManager(SponsorScanRepository sponsorScanRepository, + EventRepository eventRepository, + TicketRepository ticketRepository, + UserRepository userRepository) { this.sponsorScanRepository = sponsorScanRepository; this.eventRepository = eventRepository; this.ticketRepository = ticketRepository; + this.userRepository = userRepository; } - public Optional registerSponsorScan(int eventId, String ticketUid) { - Event event = optionally(() -> eventRepository.findById(eventId)).orElseThrow(IllegalArgumentException::new); - Ticket ticket = optionally(() -> ticketRepository.findByUUID(ticketUid)).orElseThrow(IllegalArgumentException::new); - Optional existingRegistration = sponsorScanRepository.getRegistrationTimestamp(event.getId(), ticket.getUuid()); + public TicketAndCheckInResult registerSponsorScan(String eventShortName, String ticketUid, String username) { + int userId = userRepository.getByUsername(username).getId(); + Optional maybeEvent = eventRepository.findOptionalByShortName(eventShortName); + if(!maybeEvent.isPresent()) { + return new TicketAndCheckInResult(null, new DefaultCheckInResult(CheckInStatus.EVENT_NOT_FOUND, "event not found")); + } + Event event = maybeEvent.get(); + Optional maybeTicket = optionally(() -> ticketRepository.findByUUID(ticketUid)); + if(!maybeTicket.isPresent()) { + return new TicketAndCheckInResult(null, new DefaultCheckInResult(CheckInStatus.TICKET_NOT_FOUND, "ticket not found")); + } + Ticket ticket = maybeTicket.get(); + if(ticket.getStatus() != Ticket.TicketStatus.CHECKED_IN) { + return new TicketAndCheckInResult(ticket, new DefaultCheckInResult(CheckInStatus.INVALID_TICKET_STATE, "not checked-in")); + } + Optional existingRegistration = sponsorScanRepository.getRegistrationTimestamp(userId, event.getId(), ticket.getId()); if(!existingRegistration.isPresent()) { - sponsorScanRepository.insert(ZonedDateTime.now(event.getZoneId()), event.getId(), ticket.getUuid()); - return Optional.empty(); + sponsorScanRepository.insert(userId, ZonedDateTime.now(event.getZoneId()), event.getId(), ticket.getId()); } - return existingRegistration.map(d -> d.withZoneSameInstant(event.getZoneId())); + return new TicketAndCheckInResult(ticket, new DefaultCheckInResult(CheckInStatus.SUCCESS, "success")); } + } diff --git a/src/main/java/alfio/manager/CheckInManager.java b/src/main/java/alfio/manager/CheckInManager.java index f84dea1ce0..ed3e4f27be 100644 --- a/src/main/java/alfio/manager/CheckInManager.java +++ b/src/main/java/alfio/manager/CheckInManager.java @@ -16,6 +16,10 @@ */ package alfio.manager; +import alfio.manager.support.CheckInStatus; +import alfio.manager.support.DefaultCheckInResult; +import alfio.manager.support.OnSitePaymentResult; +import alfio.manager.support.TicketAndCheckInResult; import alfio.model.Event; import alfio.model.FullTicketInfo; import alfio.model.Ticket; @@ -23,7 +27,6 @@ import alfio.repository.EventRepository; import alfio.repository.TicketRepository; import alfio.util.MonetaryUtil; -import lombok.Data; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; @@ -32,11 +35,10 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; -import java.math.BigDecimal; import java.util.List; import java.util.Optional; -import static alfio.manager.CheckInManager.CheckInStatus.*; +import static alfio.manager.support.CheckInStatus.*; import static alfio.util.OptionalWrapper.optionally; @Component @@ -44,9 +46,6 @@ @Log4j2 public class CheckInManager { - public enum CheckInStatus { - EVENT_NOT_FOUND, TICKET_NOT_FOUND, EMPTY_TICKET_CODE, INVALID_TICKET_CODE, INVALID_TICKET_STATE, ALREADY_CHECK_IN, MUST_PAY, OK_READY_TO_BE_CHECKED_IN, SUCCESS - } private final TicketRepository ticketRepository; private final EventRepository eventRepository; @@ -171,28 +170,4 @@ private TicketAndCheckInResult extractStatus(Optional maybeEvent, Optiona return new TicketAndCheckInResult(ticket, new DefaultCheckInResult(OK_READY_TO_BE_CHECKED_IN, "Ready to be checked in")); } - @Data - public static class TicketAndCheckInResult { - private final Ticket ticket; - private final CheckInResult result; - } - - @Data - public static class DefaultCheckInResult implements CheckInResult { - private final CheckInStatus status; - private final String message; - } - - @Data - public static class OnSitePaymentResult implements CheckInResult { - private final CheckInStatus status; - private final String message; - private final BigDecimal dueAmount; - private final String currency; - } - - public interface CheckInResult { - CheckInStatus getStatus(); - } - } diff --git a/src/main/java/alfio/manager/support/CheckInResult.java b/src/main/java/alfio/manager/support/CheckInResult.java new file mode 100644 index 0000000000..a3e3512e4b --- /dev/null +++ b/src/main/java/alfio/manager/support/CheckInResult.java @@ -0,0 +1,21 @@ +/** + * This file is part of alf.io. + * + * alf.io is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * alf.io is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with alf.io. If not, see . + */ +package alfio.manager.support; + +public interface CheckInResult { + CheckInStatus getStatus(); +} diff --git a/src/main/java/alfio/manager/support/CheckInStatus.java b/src/main/java/alfio/manager/support/CheckInStatus.java new file mode 100644 index 0000000000..52ae3327a2 --- /dev/null +++ b/src/main/java/alfio/manager/support/CheckInStatus.java @@ -0,0 +1,21 @@ +/** + * This file is part of alf.io. + * + * alf.io is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * alf.io is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with alf.io. If not, see . + */ +package alfio.manager.support; + +public enum CheckInStatus { + EVENT_NOT_FOUND, TICKET_NOT_FOUND, EMPTY_TICKET_CODE, INVALID_TICKET_CODE, INVALID_TICKET_STATE, ALREADY_CHECK_IN, MUST_PAY, OK_READY_TO_BE_CHECKED_IN, SUCCESS +} diff --git a/src/main/java/alfio/manager/support/DefaultCheckInResult.java b/src/main/java/alfio/manager/support/DefaultCheckInResult.java new file mode 100644 index 0000000000..2f164ddd27 --- /dev/null +++ b/src/main/java/alfio/manager/support/DefaultCheckInResult.java @@ -0,0 +1,25 @@ +/** + * This file is part of alf.io. + * + * alf.io is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * alf.io is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with alf.io. If not, see . + */ +package alfio.manager.support; + +import lombok.Data; + +@Data +public class DefaultCheckInResult implements CheckInResult { + private final CheckInStatus status; + private final String message; +} diff --git a/src/main/java/alfio/manager/support/OnSitePaymentResult.java b/src/main/java/alfio/manager/support/OnSitePaymentResult.java new file mode 100644 index 0000000000..4f9af46c34 --- /dev/null +++ b/src/main/java/alfio/manager/support/OnSitePaymentResult.java @@ -0,0 +1,29 @@ +/** + * This file is part of alf.io. + * + * alf.io is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * alf.io is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with alf.io. If not, see . + */ +package alfio.manager.support; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class OnSitePaymentResult implements CheckInResult { + private final CheckInStatus status; + private final String message; + private final BigDecimal dueAmount; + private final String currency; +} diff --git a/src/main/java/alfio/manager/support/TicketAndCheckInResult.java b/src/main/java/alfio/manager/support/TicketAndCheckInResult.java new file mode 100644 index 0000000000..d079e4ac76 --- /dev/null +++ b/src/main/java/alfio/manager/support/TicketAndCheckInResult.java @@ -0,0 +1,26 @@ +/** + * This file is part of alf.io. + * + * alf.io is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * alf.io is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with alf.io. If not, see . + */ +package alfio.manager.support; + +import alfio.model.Ticket; +import lombok.Data; + +@Data +public class TicketAndCheckInResult { + private final Ticket ticket; + private final CheckInResult result; +} diff --git a/src/main/java/alfio/repository/SponsorScanRepository.java b/src/main/java/alfio/repository/SponsorScanRepository.java index 0bccf3279b..cfda4f7246 100644 --- a/src/main/java/alfio/repository/SponsorScanRepository.java +++ b/src/main/java/alfio/repository/SponsorScanRepository.java @@ -26,9 +26,9 @@ @QueryRepository public interface SponsorScanRepository { - @Query("select creation from sponsor_scan where event_id = :eventId and ticket_id = :ticketId") - Optional getRegistrationTimestamp(@Bind("eventId") int eventId, @Bind("ticketId") String ticketId); + @Query("select creation from sponsor_scan where user_id = :userId and event_id = :eventId and ticket_id = :ticketId") + Optional getRegistrationTimestamp(@Bind("userId") int userId, @Bind("eventId") int eventId, @Bind("ticketId") int ticketId); - @Query("insert into sponsor_scan (creation, event_id, ticket_id) values(:creation, :eventId, :ticketId)") - int insert(@Bind("creation") ZonedDateTime creation, @Bind("eventId") int eventId, @Bind("ticketId") String ticketId); + @Query("insert into sponsor_scan (user_id, creation, event_id, ticket_id) values(:userId, :creation, :eventId, :ticketId)") + int insert(@Bind("userId") int userId, @Bind("creation") ZonedDateTime creation, @Bind("eventId") int eventId, @Bind("ticketId") int ticketId); } diff --git a/src/main/resources/alfio/db/HSQLDB/V14_1.7.1__ALTER_SPONSOR_SCAN.sql b/src/main/resources/alfio/db/HSQLDB/V14_1.7.1__ALTER_SPONSOR_SCAN.sql new file mode 100644 index 0000000000..af0822d0ca --- /dev/null +++ b/src/main/resources/alfio/db/HSQLDB/V14_1.7.1__ALTER_SPONSOR_SCAN.sql @@ -0,0 +1,18 @@ +-- +-- This file is part of alf.io. +-- +-- alf.io is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- alf.io is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with alf.io. If not, see . +-- + +alter table sponsor_scan add column user_id integer DEFAULT 0 NOT null; \ No newline at end of file diff --git a/src/main/resources/alfio/db/MYSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql b/src/main/resources/alfio/db/MYSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql new file mode 100644 index 0000000000..c912a6dc0f --- /dev/null +++ b/src/main/resources/alfio/db/MYSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql @@ -0,0 +1,18 @@ +-- +-- This file is part of alf.io. +-- +-- alf.io is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- alf.io is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with alf.io. If not, see . +-- + +alter table sponsor_scan add column user_id integer NOT NULL DEFAULT 0; \ No newline at end of file diff --git a/src/main/resources/alfio/db/PGSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql b/src/main/resources/alfio/db/PGSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql new file mode 100644 index 0000000000..6962b7bbb8 --- /dev/null +++ b/src/main/resources/alfio/db/PGSQL/V14_1.7.1__ALTER_SPONSOR_SCAN.sql @@ -0,0 +1,18 @@ +-- +-- This file is part of alf.io. +-- +-- alf.io is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- alf.io is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with alf.io. If not, see . +-- + +alter table sponsor_scan add column user_id integer not NULL DEFAULT 0; \ No newline at end of file diff --git a/src/test/java/alfio/controller/ReservationFlowIntegrationTest.java b/src/test/java/alfio/controller/ReservationFlowIntegrationTest.java index 1f3f988c7b..5e9467de51 100644 --- a/src/test/java/alfio/controller/ReservationFlowIntegrationTest.java +++ b/src/test/java/alfio/controller/ReservationFlowIntegrationTest.java @@ -27,10 +27,11 @@ import alfio.controller.form.ReservationForm; import alfio.controller.form.UpdateTicketOwnerForm; import alfio.controller.support.TicketDecorator; -import alfio.manager.CheckInManager; import alfio.manager.EventManager; import alfio.manager.EventStatisticsManager; import alfio.manager.i18n.I18nManager; +import alfio.manager.support.CheckInStatus; +import alfio.manager.support.TicketAndCheckInResult; import alfio.manager.user.UserManager; import alfio.model.Event; import alfio.model.TicketCategory; @@ -42,7 +43,6 @@ import alfio.repository.user.OrganizationRepository; import alfio.test.util.IntegrationTestUtil; import alfio.util.TemplateManager; -import com.opencsv.CSVParser; import com.opencsv.CSVReader; import org.apache.commons.lang3.tuple.Pair; import org.junit.Assert; @@ -61,7 +61,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; -import org.springframework.ui.ModelMap; import org.springframework.validation.BeanPropertyBindingResult; import org.springframework.validation.BindingResult; import org.springframework.validation.support.BindingAwareModelMap; @@ -80,9 +79,7 @@ import java.util.Locale; import java.util.Map; -import static alfio.test.util.IntegrationTestUtil.AVAILABLE_SEATS; -import static alfio.test.util.IntegrationTestUtil.initEvent; -import static alfio.test.util.IntegrationTestUtil.initSystemProperties; +import static alfio.test.util.IntegrationTestUtil.*; /** * @@ -290,15 +287,15 @@ updateTicketOwnerForm, new BeanPropertyBindingResult(updateTicketOwnerForm, "upd //--- check in sequence String ticketCode = ticketDecorator.ticketCode(event.getPrivateKey()); - CheckInManager.TicketAndCheckInResult ticketAndCheckInResult = checkInApiController.findTicketWithUUID(event.getId(), ticketIdentifier, ticketCode); - Assert.assertEquals(CheckInManager.CheckInStatus.OK_READY_TO_BE_CHECKED_IN, ticketAndCheckInResult.getResult().getStatus()); + TicketAndCheckInResult ticketAndCheckInResult = checkInApiController.findTicketWithUUID(event.getId(), ticketIdentifier, ticketCode); + Assert.assertEquals(CheckInStatus.OK_READY_TO_BE_CHECKED_IN, ticketAndCheckInResult.getResult().getStatus()); CheckInApiController.TicketCode tc = new CheckInApiController.TicketCode(); tc.setCode(ticketCode); - Assert.assertEquals(CheckInManager.CheckInStatus.SUCCESS, checkInApiController.checkIn(event.getId(), ticketIdentifier, tc).getResult().getStatus()); + Assert.assertEquals(CheckInStatus.SUCCESS, checkInApiController.checkIn(event.getId(), ticketIdentifier, tc).getResult().getStatus()); - CheckInManager.TicketAndCheckInResult ticketAndCheckInResultOk = checkInApiController.findTicketWithUUID(event.getId(), ticketIdentifier, ticketCode); - Assert.assertEquals(CheckInManager.CheckInStatus.ALREADY_CHECK_IN, ticketAndCheckInResultOk.getResult().getStatus()); + TicketAndCheckInResult ticketAndCheckInResultOk = checkInApiController.findTicketWithUUID(event.getId(), ticketIdentifier, ticketCode); + Assert.assertEquals(CheckInStatus.ALREADY_CHECK_IN, ticketAndCheckInResultOk.getResult().getStatus()); }