aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-03-27 18:55:39 -0400
committersowgro <tpoke.ferrari@gmail.com>2025-03-27 18:55:39 -0400
commitd6f4aad157baad7d9b25d56ce056b80805e88f5f (patch)
tree1b4a3df94389afb1637ea59fe47ba3a327c89561 /ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java
parent96f833352eff7b9428daf2add988ecd0a2b41d92 (diff)
parentddbd1cc688aa98fb275ad72a750fbaaf53e6c0ae (diff)
downloadJellySolutions-d6f4aad157baad7d9b25d56ce056b80805e88f5f.tar.gz
JellySolutions-d6f4aad157baad7d9b25d56ce056b80805e88f5f.tar.bz2
JellySolutions-d6f4aad157baad7d9b25d56ce056b80805e88f5f.zip
Merge branch 'main' into css
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;