aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java
diff options
context:
space:
mode:
authorTyler Ferrari <69283684+Sowgro@users.noreply.github.com>2025-03-27 18:50:33 -0400
committerGitHub <noreply@github.com>2025-03-27 18:50:33 -0400
commitddbd1cc688aa98fb275ad72a750fbaaf53e6c0ae (patch)
tree0a0f9669fb0f7cf2f2816b798269e50a8b26f125 /ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java
parent35d7c971ed47718d4dc5738edb09d62cd780dac4 (diff)
parent4f5e9e9ecda282a98af5d70bd6cf0540973c7314 (diff)
downloadJellySolutions-ddbd1cc688aa98fb275ad72a750fbaaf53e6c0ae.tar.gz
JellySolutions-ddbd1cc688aa98fb275ad72a750fbaaf53e6c0ae.tar.bz2
JellySolutions-ddbd1cc688aa98fb275ad72a750fbaaf53e6c0ae.zip
Merge pull request #17 from RIT-SWEN-261-02/api-cleanup
Merge api-cleanup into main
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.java27
1 files changed, 13 insertions, 14 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 99ca23c..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
@@ -27,7 +27,8 @@ public class CupboardServiceTest {
@BeforeEach
public void setupCupboardService() {
mockCupboardDAO = mock(CupboardDAO.class);
- cupboardService = new CupboardService(mockCupboardDAO);
+ AuthService mockAuthService = mock(AuthService.class);
+ cupboardService = new CupboardService(mockAuthService, mockCupboardDAO);
}
@@ -52,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;
@@ -67,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;
@@ -89,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;
@@ -115,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;
@@ -134,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;
@@ -153,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;
@@ -173,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;