From c6bf84a1578a7e1d403410a7fa9f1554dc599800 Mon Sep 17 00:00:00 2001 From: ArdyZ <45757560+ArdyZ@users.noreply.github.com> Date: Wed, 15 Dec 2021 09:37:22 +0100 Subject: [PATCH] Addding an order to the test set for local running (#547) --- .../ch/wisv/areafiftylan/utils/TestDataRunner.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/wisv/areafiftylan/utils/TestDataRunner.java b/src/main/java/ch/wisv/areafiftylan/utils/TestDataRunner.java index 95e75a926..93143cebf 100644 --- a/src/main/java/ch/wisv/areafiftylan/utils/TestDataRunner.java +++ b/src/main/java/ch/wisv/areafiftylan/utils/TestDataRunner.java @@ -28,6 +28,8 @@ import ch.wisv.areafiftylan.products.service.repository.TicketOptionRepository; import ch.wisv.areafiftylan.products.service.repository.TicketRepository; import ch.wisv.areafiftylan.products.service.repository.TicketTypeRepository; +import ch.wisv.areafiftylan.products.service.OrderService; +import ch.wisv.areafiftylan.products.model.order.Order; import ch.wisv.areafiftylan.seats.model.SeatGroupDTO; import ch.wisv.areafiftylan.seats.service.SeatService; import ch.wisv.areafiftylan.teams.model.Team; @@ -80,6 +82,7 @@ public class TestDataRunner { private final FaqRepository faqRepository; private final SponsorRepository sponsorRepository; private final TournamentRepository tournamentRepository; + private final OrderService orderService; @Autowired public TestDataRunner(UserRepository accountRepository, TicketRepository ticketRepository, @@ -88,7 +91,7 @@ public TestDataRunner(UserRepository accountRepository, TicketRepository ticketR RFIDLinkRepository rfidLinkRepository, PossibleConsumptionsRepository consumptionsRepository, ConsumptionService consumptionService, BannerRepository bannerRepository, CommitteeRepository committeeRepository, FaqRepository faqRepository, SponsorRepository sponsorRepository, - TournamentRepository tournamentRepository) { + TournamentRepository tournamentRepository, OrderService orderService) { this.accountRepository = accountRepository; this.ticketRepository = ticketRepository; this.seatService = seatService; @@ -103,6 +106,8 @@ public TestDataRunner(UserRepository accountRepository, TicketRepository ticketR this.faqRepository = faqRepository; this.sponsorRepository = sponsorRepository; this.tournamentRepository = tournamentRepository; + this.orderService = orderService; + } @EventListener(ApplicationStartedEvent.class) @@ -269,6 +274,13 @@ public void insertTestData() { tournament(TournamentType.UNOFFICIAL, "JD", "images-optimized/unofficial/justdance.jpg", "2 V 2", "Just Dance", "Just Dance is about dancing.", Collections.singletonList("Nothing."), sogeti); //endregion Web Data + //region Orders + Order order_admin = orderService.create("Normal", null); + orderService.assignOrderToUser(order_admin.getId(), userAdmin.getId()); + + Order order_normal = orderService.create("Normal", null); + orderService.assignOrderToUser(order_normal.getId(), userNormal.getId()); + //endregion Orders } private CommitteeMember committeeMember(Long position, String function, String name, String icon) {