Skip to content

Commit

Permalink
Addding an order to the test set for local running (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArdyZ authored Dec 15, 2021
1 parent 92b8da7 commit c6bf84a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/java/ch/wisv/areafiftylan/utils/TestDataRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c6bf84a

Please sign in to comment.