diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2025-03-25 10:17:55 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2025-03-25 10:17:55 -0400 |
commit | 5f03e80712f7a18370b5118fde5327bde1b6fbbf (patch) | |
tree | 17ff94c8ba74ab2bfe6195cb6dc6ca06e71f2ea3 /ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java | |
parent | 9aa8a8e80caaad9196752e2e101525a584f35a08 (diff) | |
download | JellySolutions-5f03e80712f7a18370b5118fde5327bde1b6fbbf.tar.gz JellySolutions-5f03e80712f7a18370b5118fde5327bde1b6fbbf.tar.bz2 JellySolutions-5f03e80712f7a18370b5118fde5327bde1b6fbbf.zip |
Fix tests and more cleanup
Diffstat (limited to 'ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java')
-rw-r--r-- | ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java index 59f5b1b..05ea2e8 100644 --- a/ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java +++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java @@ -23,12 +23,11 @@ public class CupboardServiceTest { private CupboardDAO mockCupboardDAO; private CupboardService cupboardService; - private AuthService mockAuthService; @BeforeEach public void setupCupboardService() { mockCupboardDAO = mock(CupboardDAO.class); - mockAuthService = mock(AuthService.class); + AuthService mockAuthService = mock(AuthService.class); cupboardService = new CupboardService(mockAuthService, mockCupboardDAO); } @@ -54,7 +53,7 @@ public class CupboardServiceTest { } @Test - public void testCreateNeedBadGoal() throws IOException, DuplicateKeyException { + public void testCreateNeedBadGoal() throws IOException { // Setup String name = "Jellyfish"; double maxGoal = -100.00; @@ -69,13 +68,12 @@ public class CupboardServiceTest { // Need response = cupboardService.createNeed(name, maxGoal, type); // Analyze - assertThrows(IllegalArgumentException.class, () -> { - cupboardService.createNeed(name, maxGoal, type); - }); + assertThrows(IllegalArgumentException.class, () -> + cupboardService.createNeed(name, maxGoal, type)); } @Test - public void testCreateNeedDuplicate() throws IOException, DuplicateKeyException { + public void testCreateNeedDuplicate() throws IOException { // Setup String name = "Jellyfish"; double maxGoal = 100.00; @@ -91,13 +89,12 @@ public class CupboardServiceTest { // Need response = cupboardService.createNeed(name, maxGoal, type); // Analyze - assertThrows(DuplicateKeyException.class, () -> { - cupboardService.createNeed(name, maxGoal, type); - }); + assertThrows(DuplicateKeyException.class, () -> + cupboardService.createNeed(name, maxGoal, type)); } @Test - public void testSearchNeeds() throws IOException, DuplicateKeyException { + public void testSearchNeeds() throws IOException { // Setup String name = "Jellyfish"; double maxGoal = 100.00; @@ -117,7 +114,7 @@ public class CupboardServiceTest { } @Test - public void testSearchNeedsFail() throws IOException, DuplicateKeyException { + public void testSearchNeedsFail() throws IOException { // Setup String name = "Jellyfish"; double maxGoal = 100.00; @@ -136,7 +133,7 @@ public class CupboardServiceTest { } @Test - public void testGetNeed() throws IOException, DuplicateKeyException { + public void testGetNeed() throws IOException { // Setup String name = "Jellyfish"; double maxGoal = 100.00; @@ -155,7 +152,7 @@ public class CupboardServiceTest { } @Test - public void testUpdateNeed() throws IOException, DuplicateKeyException { + public void testUpdateNeed() throws IOException { // Setup String name = "Jellyfish"; double maxGoal = 100.00; @@ -175,7 +172,7 @@ public class CupboardServiceTest { } @Test - public void testDeleteNeed() throws IOException, DuplicateKeyException { + public void testDeleteNeed() throws IOException { // Setup String name = "Jellyfish"; double maxGoal = 100.00; |