diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2025-03-26 18:14:47 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2025-03-26 18:14:47 -0400 |
commit | ab35efb06b926e8a3aee5cfc8d1fa908aa4a4707 (patch) | |
tree | 6f456fe322a32510c611cd787d653ed186b0777d /ufund-api/src/test/java/com/ufund/api/ufundapi/service/AuthServiceTest.java | |
parent | ea13cf6ab3b71ff5e83fca876ec71fec1f7b00ae (diff) | |
download | JellySolutions-ab35efb06b926e8a3aee5cfc8d1fa908aa4a4707.tar.gz JellySolutions-ab35efb06b926e8a3aee5cfc8d1fa908aa4a4707.tar.bz2 JellySolutions-ab35efb06b926e8a3aee5cfc8d1fa908aa4a4707.zip |
Fix cupboard access checking and logging
Diffstat (limited to 'ufund-api/src/test/java/com/ufund/api/ufundapi/service/AuthServiceTest.java')
-rw-r--r-- | ufund-api/src/test/java/com/ufund/api/ufundapi/service/AuthServiceTest.java | 12 |
1 files changed, 6 insertions, 6 deletions
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 d3085e5..4f58b12 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 @@ -40,34 +40,34 @@ public class AuthServiceTest { } @Test - public void testAuthenticate() throws IOException { + public void testKeyIsValid() throws IOException { // Mock when(mockAuthDAO.getUserAuth(key)).thenReturn(new UserAuth(key, username, null)); when(mockUserService.getUser(username)).thenReturn(user); // Analyze - assertDoesNotThrow(() -> authService.authenticate(username, key)); + assertDoesNotThrow(() -> authService.keyHasAccessToUser(username, key)); } @Test - public void testAuthenticateMismatchName() throws IOException { + public void testKeyIsValidMismatchName() 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)); + assertThrows(IllegalAccessException.class, () -> authService.keyHasAccessToUser(username, key)); } @Test - public void testAuthenticateMissingUserAuth() throws IOException { + public void testKeyIsValidMissingUserAuth() throws IOException { // Mock when(mockAuthDAO.getUserAuth(key)).thenReturn(null); // Analyze - assertThrows(IllegalAccessException.class, () -> authService.authenticate(username, key)); + assertThrows(IllegalAccessException.class, () -> authService.keyHasAccessToUser(username, key)); } |