From 6ff08c60b333960de48d6bcd720b4fa72eb0cba8 Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Mon, 17 Mar 2025 15:34:47 -0400 Subject: Added private to fields and modified setup method --- .../api/ufundapi/persistence/CupboardFileDAOTest.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ufund-api/src/test/java/com') diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/CupboardFileDAOTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/CupboardFileDAOTest.java index 7888084..f786a8c 100644 --- a/ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/CupboardFileDAOTest.java +++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/persistence/CupboardFileDAOTest.java @@ -20,17 +20,18 @@ import com.ufund.api.ufundapi.model.Need.GoalType; @Tag("Persistence-tier") public class CupboardFileDAOTest { - CupboardFileDAO cupboardFileDao; - Need[] testNeeds; - ObjectMapper mockObjectMapper; + private CupboardFileDAO cupboardFileDao; + private Need[] testNeeds; + private ObjectMapper mockObjectMapper; @BeforeEach public void setupCupboardFileDao() throws IOException { mockObjectMapper = mock(ObjectMapper.class); - testNeeds = new Need[3]; - testNeeds[0] = new Need("one", 0, 100, Need.GoalType.MONETARY); - testNeeds[1] = new Need("two", 1, 100, Need.GoalType.MONETARY); - testNeeds[2] = new Need("three", 2, 100, Need.GoalType.MONETARY); + testNeeds = new Need[]{ + new Need("one", 0, 100, Need.GoalType.MONETARY), + new Need("two", 1, 100, Need.GoalType.MONETARY), + new Need("three", 2, 100, Need.GoalType.MONETARY) + }; // When the object mapper is supposed to read from the file // the mock object mapper will return the hero array above when(mockObjectMapper -- cgit v1.2.3