From 19277c810dacf0a96db1b9b5555574e78225e322 Mon Sep 17 00:00:00 2001 From: KronosDP <darrel.danadyaksa19@gmail.com> Date: Wed, 26 Feb 2025 20:16:08 +0700 Subject: [PATCH] [REFACTOR] Update exception type in AuthenticationServiceTest for social login --- .../authentication/service/AuthenticationServiceTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/safetypin/authentication/service/AuthenticationServiceTest.java b/src/test/java/com/safetypin/authentication/service/AuthenticationServiceTest.java index bdf05fe..b1f12b9 100644 --- a/src/test/java/com/safetypin/authentication/service/AuthenticationServiceTest.java +++ b/src/test/java/com/safetypin/authentication/service/AuthenticationServiceTest.java @@ -121,7 +121,7 @@ class AuthenticationServiceTest { LocalDate.now().minusYears(30), "EMAIL", null); when(userRepository.findByEmail("social@example.com")).thenReturn(existingUser); - Exception exception = assertThrows(IllegalArgumentException.class, () -> + Exception exception = assertThrows(UserAlreadyExistsException.class, () -> authenticationService.socialLogin(request) ); assertTrue(exception.getMessage().contains("An account with this email exists")); -- GitLab