From fd3fcd8f0e13e32774c020aee1b46e91d9b96c50 Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Sun, 30 Mar 2025 18:52:27 -0400 Subject: Fixed 2 broken tests in CupboardControllerTest --- .../ufundapi/controller/CupboardControllerTest.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'ufund-api') diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/CupboardControllerTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/CupboardControllerTest.java index 4702771..75dbf84 100644 --- a/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/CupboardControllerTest.java +++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/CupboardControllerTest.java @@ -97,12 +97,14 @@ public class CupboardControllerTest { @Test public void createNeedConflict() throws IOException, DuplicateKeyException { - when(mockCupboardService.createNeed("Name", "Atlantis", 100, Need.GoalType.MONETARY, false)).thenThrow(new DuplicateKeyException("")); + when(mockCupboardService.createNeed("Test", "Atlantis", 100, Need.GoalType.MONETARY, false)).thenThrow(new DuplicateKeyException("")); Map needMap = Map.ofEntries( - entry("name", "Name"), - entry("maxGoal", 100.0), - entry("type", "MONETARY") + entry("name", "Test"), + entry("location", "Atlantis"), + entry("maxGoal", 100), + entry("type", "MONETARY"), + entry("urgent", false) ); var res = cupboardController.createNeed(needMap, key); @@ -115,9 +117,11 @@ public class CupboardControllerTest { doThrow(new IllegalAccessException()).when(mockAuthService).keyHasAccessToCupboard(key); Map needMap = Map.ofEntries( - entry("name", "Name"), - entry("maxGoal", 100.0), - entry("type", "MONETARY") + entry("name", "Test"), + entry("location", "Atlantis"), + entry("maxGoal", 100), + entry("type", "MONETARY"), + entry("urgent", false) ); var res = cupboardController.createNeed(needMap, key); -- cgit v1.2.3