diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2025-03-30 14:34:10 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2025-03-30 14:34:10 -0400 |
commit | 9fba1c4af3c9b5aad206ec76469c1625125ea799 (patch) | |
tree | b31f52745944cfd6159b6fcef60b19fe4c80a3dc /ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java | |
parent | f23afc7f3b0b62384b3b54a0864b02abc3b48b01 (diff) | |
parent | 0c793d302c5065085ff7982a68f7ed449d84d6dc (diff) | |
download | JellySolutions-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/controller/UserControllerTest.java')
-rw-r--r-- | ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java index 5542f49..06fb6cd 100644 --- a/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java +++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java @@ -82,7 +82,7 @@ public class UserControllerTest { String key = UserAuth.generate(username).getKey(); // When getUser is called on the Mock User service, throw an IOException // doThrow(new IllegalAccessException()).when(mockUserService).getUser(username); - doThrow(new IllegalAccessException()).when(mockAuthService).authenticate(username, key); + doThrow(new IllegalAccessException()).when(mockAuthService).keyHasAccessToUser(username, key); // Invoke ResponseEntity<User> response = userController.getUser(username, key); @@ -237,14 +237,14 @@ public class UserControllerTest { String key = UserAuth.generate(username).getKey(); // When updateUser is called on the Mock User service, throw a Invalid Parameter exception // exception - doThrow(new IllegalAccessException()).when(mockAuthService).authenticate(username, key); + doThrow(new IllegalAccessException()).when(mockAuthService).keyHasAccessToUser(username, key); // Invoke ResponseEntity<User> response = userController.updateUser(user, username, key); // Analyze - assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode()); + assertEquals(HttpStatus.UNAUTHORIZED, response.getStatusCode()); } @Test @@ -298,7 +298,7 @@ public class UserControllerTest { String username = "Test"; String key = UserAuth.generate(username).getKey(); // When deleteUser is called on the Mock User service, throw an IOException - doThrow(new IllegalAccessException()).when(mockAuthService).authenticate(username, key); + doThrow(new IllegalAccessException()).when(mockAuthService).keyHasAccessToUser(username, key); // Invoke ResponseEntity<Boolean> response = userController.deleteUser(username, key); |