From b79fbecb98030354bd97f89328045772cd42917d Mon Sep 17 00:00:00 2001 From: Theo Reichert Date: Fri, 19 Jan 2024 18:20:57 +0100 Subject: [PATCH] Replace order id in template with order type --- src/main/java/catering/order/OrderController.java | 2 +- .../java/catering/order/OrderControllerIntegrationTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/catering/order/OrderController.java b/src/main/java/catering/order/OrderController.java index c9d656e..613185b 100644 --- a/src/main/java/catering/order/OrderController.java +++ b/src/main/java/catering/order/OrderController.java @@ -379,7 +379,7 @@ public class OrderController { String order_id = Objects.requireNonNull(order.getId()).toString(); for (int i = start_index_inclusive; i < end_index_exclusive; i++) { // FIXME: exchange order ids for a short name or a color - datesOfMonth.get(i).add(order_id); + datesOfMonth.get(i).add(order.getOrderType().toHumanReadable()); } } diff --git a/src/test/java/catering/order/OrderControllerIntegrationTests.java b/src/test/java/catering/order/OrderControllerIntegrationTests.java index e628a9e..e7e9928 100644 --- a/src/test/java/catering/order/OrderControllerIntegrationTests.java +++ b/src/test/java/catering/order/OrderControllerIntegrationTests.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023 swt23w23 +// SPDX-FileCopyrightText: 2023-2024 swt23w23 package catering.order; import catering.staff.JobType; @@ -300,6 +300,6 @@ public class OrderControllerIntegrationTests { void adminViewsCalender() throws Exception { mvc.perform(get("/orders/calender")) .andExpect(status().isOk()) - .andExpect(content().string(containsString(myOrder.getId().toString()))); + .andExpect(content().string(containsString(myOrder.getOrderType().toHumanReadable()))); } }