aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.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/controller/UserControllerTest.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/controller/UserControllerTest.java')
-rw-r--r--ufund-api/src/test/java/com/ufund/api/ufundapi/controller/UserControllerTest.java8
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);