aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/test/java/com/ufund/api/ufundapi/service
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-03-31 20:44:22 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-03-31 20:44:22 -0400
commitcd8b846a4455aba7664cc03e219f471d251ff9bf (patch)
tree68f0cf06368cfd707be6ce54772a1ee14e6fa35f /ufund-api/src/test/java/com/ufund/api/ufundapi/service
parente1ef22279baccb4b2a5a1ecbb5222e4008d4d523 (diff)
downloadJellySolutions-cd8b846a4455aba7664cc03e219f471d251ff9bf.tar.gz
JellySolutions-cd8b846a4455aba7664cc03e219f471d251ff9bf.tar.bz2
JellySolutions-cd8b846a4455aba7664cc03e219f471d251ff9bf.zip
Fixed broken tests due to new need fields
Diffstat (limited to 'ufund-api/src/test/java/com/ufund/api/ufundapi/service')
-rw-r--r--ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java40
1 files changed, 28 insertions, 12 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 f3cbc23..2a3c8ee 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
@@ -40,14 +40,16 @@ public class CupboardServiceTest {
double maxGoal = 100;
GoalType type = Need.GoalType.MONETARY;
boolean urgent = false;
- var need = new Need(name, location, maxGoal, type, urgent);
+ String image = "";
+ String description = "";
+ var need = new Need(name, image, location, maxGoal, type, urgent, description);
// When the same id is passed in, our mock User DAO will return the User object
when(mockCupboardDAO.addNeed(any())).thenReturn(need);
when(mockCupboardDAO.getNeeds()).thenReturn(new Need[0]);
// Invoke
- Need response = cupboardService.createNeed(name, location, maxGoal, type, urgent);
+ Need response = cupboardService.createNeed(name, location, image, maxGoal, type, urgent, description);
// Analyze
assertNotNull(response);
@@ -62,7 +64,9 @@ public class CupboardServiceTest {
double maxGoal = -100.0;
GoalType type = Need.GoalType.MONETARY;
boolean urgent = false;
- var need = new Need(name, location, maxGoal, type, urgent);
+ String image = "";
+ String description = "";
+ var need = new Need(name, image, location, maxGoal, type, urgent, description);
// When the same id is passed in, our mock User DAO will return the User object
when(mockCupboardDAO.addNeed(any())).thenReturn(need);
@@ -73,7 +77,7 @@ public class CupboardServiceTest {
// Analyze
assertThrows(IllegalArgumentException.class, () ->
- cupboardService.createNeed(name, location, maxGoal, type, urgent));
+ cupboardService.createNeed(name, location, image, maxGoal, type, urgent, description));
}
@Test
@@ -84,7 +88,9 @@ public class CupboardServiceTest {
double maxGoal = 100.0;
GoalType type = Need.GoalType.MONETARY;
boolean urgent = false;
- var need = new Need(name, location, maxGoal, type, urgent);
+ String image = "";
+ String description = "";
+ var need = new Need(name, image, location, maxGoal, type, urgent, description);
Need[] needs = { need };
// When the same id is passed in, our mock User DAO will return the User object
@@ -96,7 +102,7 @@ public class CupboardServiceTest {
// Analyze
assertThrows(DuplicateKeyException.class, () ->
- cupboardService.createNeed(name, location, maxGoal, type, urgent));
+ cupboardService.createNeed(name, location, image, maxGoal, type, urgent, description));
}
@Test
@@ -107,7 +113,9 @@ public class CupboardServiceTest {
double maxGoal = 100.0;
GoalType type = Need.GoalType.MONETARY;
boolean urgent = false;
- var need = new Need(name, location, maxGoal, type, urgent);
+ String image = "";
+ String description = "";
+ var need = new Need(name, image, location, maxGoal, type, urgent, description);
Need[] needs = { need };
// When the same id is passed in, our mock User DAO will return the User object
@@ -129,7 +137,9 @@ public class CupboardServiceTest {
double maxGoal = 100.0;
GoalType type = Need.GoalType.MONETARY;
boolean urgent = false;
- var need = new Need(name, location, maxGoal, type, urgent);
+ String image = "";
+ String description = "";
+ var need = new Need(name, image, location, maxGoal, type, urgent, description);
Need[] needs = { need };
// When the same id is passed in, our mock User DAO will return the User object
@@ -150,7 +160,9 @@ public class CupboardServiceTest {
double maxGoal = 100.0;
GoalType type = Need.GoalType.MONETARY;
boolean urgent = false;
- var need = new Need(name, location, maxGoal, type, urgent);
+ String image = "";
+ String description = "";
+ var need = new Need(name, image, location, maxGoal, type, urgent, description);
// When the same id is passed in, our mock User DAO will return the User object
when(mockCupboardDAO.getNeed(0)).thenReturn(need);
@@ -170,8 +182,10 @@ public class CupboardServiceTest {
double maxGoal = 100.0;
GoalType type = Need.GoalType.MONETARY;
boolean urgent = false;
- Need need = new Need(name, location, maxGoal, type, urgent);
- Need newNeed = new Need("Octopus", location, maxGoal, type, urgent);
+ String image = "";
+ String description = "";
+ var need = new Need(name, image, location, maxGoal, type, urgent, description);
+ Need newNeed = new Need("Octopus", image, location, maxGoal, type, urgent, description);
// When the same id is passed in, our mock User DAO will return the User object
when(mockCupboardDAO.updateNeed(any())).thenReturn(newNeed);
@@ -191,7 +205,9 @@ public class CupboardServiceTest {
double maxGoal = 100.0;
GoalType type = Need.GoalType.MONETARY;
boolean urgent = false;
- Need need = new Need(name, location, maxGoal, type, urgent);
+ String image = "";
+ String description = "";
+ var need = new Need(name, image, location, maxGoal, type, urgent, description);
// When the same id is passed in, our mock User DAO will return the User object
when(mockCupboardDAO.deleteNeed(0)).thenReturn(true);