diff --git a/src/test/java/com/safetypin/authentication/service/AuthenticationServiceTest.java b/src/test/java/com/safetypin/authentication/service/AuthenticationServiceTest.java index bdf05fe2aff6bbe0aeeb8881b724e57d1b61ccb2..b1f12b98afad89337d33776e9dad7d56313440de 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"));