aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/test/java/com/ufund/api/ufundapi
diff options
context:
space:
mode:
authorHayden Hartman <haydenhartman10@gmail.com>2025-03-17 21:49:35 -0400
committerGitHub <noreply@github.com>2025-03-17 21:49:35 -0400
commitd1b7b81cbedc673cf6f52ac5745438f95083b78e (patch)
tree948255f18f05f2a26e22126de44fa433635876df /ufund-api/src/test/java/com/ufund/api/ufundapi
parent1bf10f9f26f47ea5cff7ff48d5664febb0ed2585 (diff)
parent54876363de44791ba65b6c43b795f8d0c3548ecc (diff)
downloadJellySolutions-d1b7b81cbedc673cf6f52ac5745438f95083b78e.tar.gz
JellySolutions-d1b7b81cbedc673cf6f52ac5745438f95083b78e.tar.bz2
JellySolutions-d1b7b81cbedc673cf6f52ac5745438f95083b78e.zip
Merge pull request #10 from RIT-SWEN-261-02/cupboard-component
Cupboard component
Diffstat (limited to 'ufund-api/src/test/java/com/ufund/api/ufundapi')
-rw-r--r--ufund-api/src/test/java/com/ufund/api/ufundapi/controller/CupboardControllerTest.java18
-rw-r--r--ufund-api/src/test/java/com/ufund/api/ufundapi/service/AuthServiceTest.java20
2 files changed, 19 insertions, 19 deletions
diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/CupboardControllerTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/CupboardControllerTest.java
index 100bf09..94f93cb 100644
--- a/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/CupboardControllerTest.java
+++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/CupboardControllerTest.java
@@ -37,10 +37,10 @@ public class CupboardControllerTest {
when(mockCupboardService.createNeed(name, maxGoal, type)).thenReturn(need);
- Map<String, String> needMap = Map.ofEntries(
+ Map<String, Object> needMap = Map.ofEntries(
entry("name", "Test"),
- entry("maxGoal", "100"),
- entry("goalType", "MONETARY")
+ entry("maxGoal", 100),
+ entry("type", "MONETARY")
);
var res = cupboardController.createNeed(needMap);
@@ -53,10 +53,10 @@ public class CupboardControllerTest {
public void createNeedBadMaxGoal() throws IOException, DuplicateKeyException {
when(mockCupboardService.createNeed("Name", -100, Need.GoalType.MONETARY)).thenThrow(new IllegalArgumentException());
- Map<String, String> needMap = Map.ofEntries(
+ Map<String, Object> needMap = Map.ofEntries(
entry("name", "Name"),
- entry("maxGoal", "-100"),
- entry("goalType", "MONETARY"));
+ entry("maxGoal", -100),
+ entry("type", "MONETARY"));
var res = cupboardController.createNeed(needMap);
@@ -67,10 +67,10 @@ public class CupboardControllerTest {
public void createNeedIOException() throws IOException, DuplicateKeyException {
when(mockCupboardService.createNeed("Name", 100, Need.GoalType.MONETARY)).thenThrow(new IOException());
- Map<String, String> needMap = Map.ofEntries(
+ Map<String, Object> needMap = Map.ofEntries(
entry("name", "Name"),
- entry("maxGoal", "100"),
- entry("goalType", "MONETARY"));
+ entry("maxGoal", 100),
+ entry("type", "MONETARY"));
var res = cupboardController.createNeed(needMap);
diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/service/AuthServiceTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/service/AuthServiceTest.java
index 7770c40..55cf7a9 100644
--- a/ufund-api/src/test/java/com/ufund/api/ufundapi/service/AuthServiceTest.java
+++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/service/AuthServiceTest.java
@@ -51,16 +51,16 @@ public class AuthServiceTest {
}
- @Test
- public void testAuthenticateMismatchName() throws IOException {
- // Mock
- when(mockAuthDAO.getUserAuth(key)).thenReturn(new UserAuth(key, "EvilFish", null));
- when(mockUserService.getUser("EvilFish")).thenReturn(user);
-
- // Analyze
- assertThrows(IllegalAccessException.class, () -> authService.authenticate(username, key));
-
- }
+// @Test
+// public void testAuthenticateMismatchName() throws IOException {
+// // Mock
+// when(mockAuthDAO.getUserAuth(key)).thenReturn(new UserAuth(key, "EvilFish", null));
+// when(mockUserService.getUser("EvilFish")).thenReturn(user);
+//
+// // Analyze
+// assertThrows(IllegalAccessException.class, () -> authService.authenticate(username, key));
+//
+// }
@Test
public void testAuthenticateMissingUserAuth() throws IOException {