Update CatalogUnitTests

This commit is contained in:
Theo Reichert 2024-01-19 18:48:05 +01:00 committed by Theo Reichert
parent c1e561821c
commit d77f1aaa9e

View file

@ -1,7 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-FileCopyrightText: 2023 swt23w23 // SPDX-FileCopyrightText: 2023-2024 swt23w23
package catering.catalog; package catering.catalog;
import catering.order.OrderType; import catering.order.OrderType;
import catering.orderCatalog.CustomCatalogEntryRepository;
import org.javamoney.moneta.Money; import org.javamoney.moneta.Money;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
@ -9,6 +10,8 @@ import static org.assertj.core.api.Assertions.*;
import static org.salespointframework.core.Currencies.EURO; import static org.salespointframework.core.Currencies.EURO;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.salespointframework.inventory.UniqueInventory;
import org.salespointframework.inventory.UniqueInventoryItem;
import org.salespointframework.quantity.Metric; import org.salespointframework.quantity.Metric;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -19,8 +22,20 @@ class CatalogUnitTests {
@Autowired @Autowired
CateringCatalog cateringCatalog; CateringCatalog cateringCatalog;
@Autowired
UniqueInventory<UniqueInventoryItem> inventory;
@Autowired
CustomCatalogEntryRepository catalogEntryRepository;
@BeforeEach @BeforeEach
void setUp() {} void setUp() {
catalogEntryRepository.deleteAll();
inventory.deleteAll();
cateringCatalog.deleteAll();
CatalogDataInitializer catalogDataInitializer = new CatalogDataInitializer(cateringCatalog);
catalogDataInitializer.initialize();
}
@Test @Test
void findByCategories() { void findByCategories() {