From d77f1aaa9e0d1914ad74e9a441bd4f58c71a5b1b Mon Sep 17 00:00:00 2001 From: Theo Reichert Date: Fri, 19 Jan 2024 18:48:05 +0100 Subject: [PATCH] Update CatalogUnitTests --- .../catering/catalog/CatalogUnitTests.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/test/java/catering/catalog/CatalogUnitTests.java b/src/test/java/catering/catalog/CatalogUnitTests.java index 1d942b6..882560c 100644 --- a/src/test/java/catering/catalog/CatalogUnitTests.java +++ b/src/test/java/catering/catalog/CatalogUnitTests.java @@ -1,7 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023 swt23w23 +// SPDX-FileCopyrightText: 2023-2024 swt23w23 package catering.catalog; import catering.order.OrderType; +import catering.orderCatalog.CustomCatalogEntryRepository; import org.javamoney.moneta.Money; import java.util.Optional; import java.util.Set; @@ -9,6 +10,8 @@ import static org.assertj.core.api.Assertions.*; import static org.salespointframework.core.Currencies.EURO; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.salespointframework.inventory.UniqueInventory; +import org.salespointframework.inventory.UniqueInventoryItem; import org.salespointframework.quantity.Metric; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -19,8 +22,20 @@ class CatalogUnitTests { @Autowired CateringCatalog cateringCatalog; + @Autowired + UniqueInventory inventory; + + @Autowired + CustomCatalogEntryRepository catalogEntryRepository; + @BeforeEach - void setUp() {} + void setUp() { + catalogEntryRepository.deleteAll(); + inventory.deleteAll(); + cateringCatalog.deleteAll(); + CatalogDataInitializer catalogDataInitializer = new CatalogDataInitializer(cateringCatalog); + catalogDataInitializer.initialize(); + } @Test void findByCategories() {