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-30 14:34:10 -0400
committersowgro <tpoke.ferrari@gmail.com>2025-03-30 14:34:10 -0400
commit9fba1c4af3c9b5aad206ec76469c1625125ea799 (patch)
treeb31f52745944cfd6159b6fcef60b19fe4c80a3dc /ufund-api/src/test/java/com/ufund/api/ufundapi/service/CupboardServiceTest.java
parentf23afc7f3b0b62384b3b54a0864b02abc3b48b01 (diff)
parent0c793d302c5065085ff7982a68f7ed449d84d6dc (diff)
downloadJellySolutions-9fba1c4af3c9b5aad206ec76469c1625125ea799.tar.gz
JellySolutions-9fba1c4af3c9b5aad206ec76469c1625125ea799.tar.bz2
JellySolutions-9fba1c4af3c9b5aad206ec76469c1625125ea799.zip
Merge remote-tracking branch 'origin/main' into list-and-cupboard-component-refactor
# Conflicts: # ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java # ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java # ufund-ui/src/app/components/cupboard/cupboard.component.ts # ufund-ui/src/app/components/need-list/need-list.component.ts # ufund-ui/src/app/models/Need.ts
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;