Skip to content

Commit

Permalink
Add the order repository to the TestDataRunner (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArdyZ authored Dec 19, 2021
1 parent c6bf84a commit 2b93df6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/ch/wisv/areafiftylan/utils/TestDataRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import ch.wisv.areafiftylan.products.model.Ticket;
import ch.wisv.areafiftylan.products.model.TicketOption;
import ch.wisv.areafiftylan.products.model.TicketType;
import ch.wisv.areafiftylan.products.service.repository.OrderRepository;
import ch.wisv.areafiftylan.products.service.repository.TicketOptionRepository;
import ch.wisv.areafiftylan.products.service.repository.TicketRepository;
import ch.wisv.areafiftylan.products.service.repository.TicketTypeRepository;
Expand Down Expand Up @@ -83,6 +84,7 @@ public class TestDataRunner {
private final SponsorRepository sponsorRepository;
private final TournamentRepository tournamentRepository;
private final OrderService orderService;
private final OrderRepository orderRepository;

@Autowired
public TestDataRunner(UserRepository accountRepository, TicketRepository ticketRepository,
Expand All @@ -91,7 +93,7 @@ public TestDataRunner(UserRepository accountRepository, TicketRepository ticketR
RFIDLinkRepository rfidLinkRepository, PossibleConsumptionsRepository consumptionsRepository,
ConsumptionService consumptionService, BannerRepository bannerRepository, CommitteeRepository committeeRepository,
FaqRepository faqRepository, SponsorRepository sponsorRepository,
TournamentRepository tournamentRepository, OrderService orderService) {
TournamentRepository tournamentRepository, OrderService orderService, OrderRepository orderRepository) {
this.accountRepository = accountRepository;
this.ticketRepository = ticketRepository;
this.seatService = seatService;
Expand All @@ -107,6 +109,7 @@ public TestDataRunner(UserRepository accountRepository, TicketRepository ticketR
this.sponsorRepository = sponsorRepository;
this.tournamentRepository = tournamentRepository;
this.orderService = orderService;
this.orderRepository = orderRepository;

}

Expand Down Expand Up @@ -277,9 +280,11 @@ public void insertTestData() {
//region Orders
Order order_admin = orderService.create("Normal", null);
orderService.assignOrderToUser(order_admin.getId(), userAdmin.getId());
orderRepository.save(order_admin);

Order order_normal = orderService.create("Normal", null);
orderService.assignOrderToUser(order_normal.getId(), userNormal.getId());
orderRepository.save(order_admin);
//endregion Orders
}

Expand Down

0 comments on commit 2b93df6

Please sign in to comment.