From 5dd91dc67e3a4a40ceb693182dcfd8b4445327b1 Mon Sep 17 00:00:00 2001 From: Ron Azar Date: Sun, 15 Sep 2024 11:29:39 +0300 Subject: [PATCH 1/5] All unit tests using Mock --- .../academy/unitests/keren/userService.kt | 60 ++++++++++ .../academy/unitests/keren/UserServiceTest.kt | 110 ++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 src/main/kotlin/com/hibob/academy/unitests/keren/userService.kt create mode 100644 src/test/kotlin/com/hibob/academy/unitests/keren/UserServiceTest.kt diff --git a/src/main/kotlin/com/hibob/academy/unitests/keren/userService.kt b/src/main/kotlin/com/hibob/academy/unitests/keren/userService.kt new file mode 100644 index 000000000..e61caffcc --- /dev/null +++ b/src/main/kotlin/com/hibob/academy/unitests/keren/userService.kt @@ -0,0 +1,60 @@ +package com.hibob.bootcamp.unittests + +data class User(val id: Long, val name: String, val email: String, val password: String, val isEmailVerified: Boolean = false) + +interface UserDao { + fun findById(userId: Long): User? + fun save(user: User): Boolean + fun update(user: User): Boolean +} + +interface NotificationService { + fun sendEmail(email: String, message: String): Boolean +} + +interface EmailVerificationService { + fun sendVerificationEmail(email: String): Boolean + fun verifyEmail(email: String, token: String): Boolean +} + +class UserService( + private val userDao: UserDao, + private val notificationService: NotificationService, + private val emailVerificationService: EmailVerificationService +) { + fun registerUser(user: User): Boolean { + if (userDao.findById(user.id) != null) { + throw IllegalArgumentException("User already exists") + } + + val isSaved = userDao.save(user.copy(isEmailVerified = false)) + if (!isSaved) { + throw IllegalStateException("User registration failed") + } + + val isVerificationEmailSent = emailVerificationService.sendVerificationEmail(user.email) + if (!isVerificationEmailSent) { + throw IllegalStateException("Failed to send verification email") + } + + return true + } + + fun verifyUserEmail(userId: Long, token: String): Boolean { + val user = userDao.findById(userId) ?: throw IllegalArgumentException("User not found") + + val isEmailVerified = emailVerificationService.verifyEmail(user.email, token) + if (!isEmailVerified) { + throw IllegalArgumentException("Email verification failed") + } + + val updatedUser = user.copy(isEmailVerified = true) + val isUpdated = userDao.update(updatedUser) + + if (isUpdated) { + notificationService.sendEmail(user.email, "Welcome ${user.name}!") + } + + return isUpdated + } +} diff --git a/src/test/kotlin/com/hibob/academy/unitests/keren/UserServiceTest.kt b/src/test/kotlin/com/hibob/academy/unitests/keren/UserServiceTest.kt new file mode 100644 index 000000000..392837c86 --- /dev/null +++ b/src/test/kotlin/com/hibob/academy/unitests/keren/UserServiceTest.kt @@ -0,0 +1,110 @@ +package com.hibob.academy.unitests.keren + +import com.hibob.bootcamp.unittests.* +import org.hibernate.validator.internal.util.Contracts.assertTrue +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Assertions.assertFalse +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertThrows +import org.mockito.kotlin.* + +class UserServiceTest{ + val token = "Waffle" + val id: Long= 123 + val name: String = "Ron Azar" + val email: String = "ron.azar@hibob.io" + val password: String ="12345" + val isEmailValid = true + + private val user = User(id,name, email ,password, isEmailValid) + private val userDao= mock{} + private val notificationService= mock{} + private val emailVerificationService= mock{} + private val userService=UserService(userDao,notificationService,emailVerificationService) + + @Test + fun `Test register user findById -- User already exists`(){ + whenever( userDao.findById(user.id)).thenReturn(user) + val errorMessage = assertThrows{ + userService.registerUser(user) + } + assertEquals("User already exists",errorMessage.message) + + // Verifying that save and sendVerificationEmail are NOT called because the user exists + verify(userDao, never()).save(any()) + verify(emailVerificationService, never()).sendVerificationEmail(any()) + } + + @Test + fun `Test register user findByEmail -- User registration failed`(){ + whenever( userDao.findById(user.id)).thenReturn(null) + whenever(userDao.save(user.copy(isEmailVerified = false))).thenReturn(false) + val errorMessage = assertThrows{ + userService.registerUser(user) + } + assertEquals("User registration failed",errorMessage.message) + + verify(emailVerificationService, never()).sendVerificationEmail(any()) + } + + @Test + fun `Test register user findByEmail -- Failed to send verification email`(){ + whenever( userDao.findById(user.id)).thenReturn(null) + whenever(userDao.save(user.copy(isEmailVerified = false))).thenReturn(true) + whenever(emailVerificationService.sendVerificationEmail(user.email)).thenReturn(false) + val errorMessage = assertThrows{ + userService.registerUser(user) + } + assertEquals("Failed to send verification email",errorMessage.message) + } + + @Test + fun `Test register user findByEmail -- Successfully registered user`(){ + whenever( userDao.findById(user.id)).thenReturn(null) + whenever(userDao.save(user.copy(isEmailVerified = false))).thenReturn(true) + whenever(emailVerificationService.sendVerificationEmail(user.email)).thenReturn(true) + assertTrue(userService.registerUser(user),"User not added") + } + + @Test + fun `verify User Email -- User not found`(){ + whenever( userDao.findById(id)).thenReturn(null) + val errorMessage = assertThrows{ + userService.verifyUserEmail(id,token) + } + assertEquals("User not found",errorMessage.message) + verify(emailVerificationService, never()).verifyEmail(any(), any()) + verify(userDao, never()).save(any()) + verify(userDao, never()).update(any()) + } + + @Test + fun `Test verify User Email -- Email verification failed`(){ + whenever( userDao.findById(id)).thenReturn(user) + whenever(emailVerificationService.verifyEmail(user.email, token)).thenReturn(false) + val errorMessage = assertThrows{ + userService.verifyUserEmail(id,token) + } + assertEquals("Email verification failed",errorMessage.message) + verify(userDao, never()).save(any()) + verify(userDao, never()).update(any()) + } + + @Test + fun `Test verify User Email -- isUpdated-true- send email`(){ + whenever( userDao.findById(id)).thenReturn(user) + whenever(emailVerificationService.verifyEmail(user.email, token)).thenReturn(true) + val updatedUser = user.copy() + whenever(userDao.update(updatedUser)).thenReturn(true) + assertTrue(userService.verifyUserEmail(id,token),"User updated") + } + + @Test + fun `Test verify User Email -- isUpdated-false- dont send email`(){ + whenever( userDao.findById(id)).thenReturn(user) + whenever(emailVerificationService.verifyEmail(user.email, token)).thenReturn(true) + val updatedUser = user.copy() + whenever(userDao.update(updatedUser)).thenReturn(false) + assertFalse(userService.verifyUserEmail(id,token),"User updated") + } +} \ No newline at end of file From 2b2230ba1c66236887341a97d019edc0e5803ac1 Mon Sep 17 00:00:00 2001 From: Ron Azar Date: Sun, 15 Sep 2024 17:34:17 +0300 Subject: [PATCH 2/5] trying to fix gradle --- build.gradle.kts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index ac5dec817..d033ae856 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -65,4 +65,7 @@ tasks { } systemProperty("spring.profiles.active", "development,test") } + bootRun { + mainClass.set("com.hibob.AcademyApplication") // Replace with your actual main class + } } From b46b1cce6b56bf3f81f44dad11c4b92d1aa958b8 Mon Sep 17 00:00:00 2001 From: Ron Azar Date: Sun, 15 Sep 2024 17:39:37 +0300 Subject: [PATCH 3/5] trying to fix gradle --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index d033ae856..43fb53e71 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -66,6 +66,6 @@ tasks { systemProperty("spring.profiles.active", "development,test") } bootRun { - mainClass.set("com.hibob.AcademyApplication") // Replace with your actual main class + mainClass.set("com.hibob.AcademyApplicationKt") // Replace with your actual main class } } From 932977cd48f619dfd152889e92f6e2c1bdf42b56 Mon Sep 17 00:00:00 2001 From: Ron Azar Date: Sun, 15 Sep 2024 17:56:54 +0300 Subject: [PATCH 4/5] trying to fix gradle --- .../com/hibob/{KotlinBasics => academy/basics}/extentions.kt | 2 +- .../Basics => com/hibob/academy/basicsomri}/LoopsOmriLec02.kt | 2 +- .../Keren => com/hibob/academy/nullability}/Q1.kt | 2 +- .../Keren => com/hibob/academy/nullability}/Q2.kt | 2 +- .../Keren => com/hibob/academy/nullability}/Q3.kt | 2 +- .../Keren => com/hibob/academy/nullability}/Q4.kt | 2 +- .../Keren => com/hibob/academy/nullability}/Q5.kt | 2 +- .../Keren => com/hibob/academy/nullability}/Q6.kt | 2 +- .../Keren => com/hibob/academy/nullability}/Q7.kt | 4 ++-- .../Keren => com/hibob/academy/nullability}/Q8.kt | 2 +- .../Keren => com/hibob/academy/nullability}/Q9.kt | 2 +- .../{sequence => com/hibob/academy}/omri/SequenceClassEx.kt | 2 +- .../hibob/academy/properties}/PropertiesTamirClassEx.kt | 2 +- .../hibob/academy/tamir}/TamirLec01 class exercise.kt | 2 +- .../kotlin/{lambda => com/hibob/academy}/yael/lambdaYael.kt | 4 ++-- 15 files changed, 17 insertions(+), 17 deletions(-) rename src/main/kotlin/com/hibob/{KotlinBasics => academy/basics}/extentions.kt (92%) rename src/main/kotlin/{Omri/Basics => com/hibob/academy/basicsomri}/LoopsOmriLec02.kt (96%) rename src/main/kotlin/{NullAbilityUpdated/Keren => com/hibob/academy/nullability}/Q1.kt (94%) rename src/main/kotlin/{NullAbilityUpdated/Keren => com/hibob/academy/nullability}/Q2.kt (92%) rename src/main/kotlin/{NullAbilityUpdated/Keren => com/hibob/academy/nullability}/Q3.kt (93%) rename src/main/kotlin/{NullAbilityUpdated/Keren => com/hibob/academy/nullability}/Q4.kt (96%) rename src/main/kotlin/{NullAbilityUpdated/Keren => com/hibob/academy/nullability}/Q5.kt (96%) rename src/main/kotlin/{NullAbilityUpdated/Keren => com/hibob/academy/nullability}/Q6.kt (97%) rename src/main/kotlin/{NullAbilityUpdated/Keren => com/hibob/academy/nullability}/Q7.kt (93%) rename src/main/kotlin/{NullAbilityUpdated/Keren => com/hibob/academy/nullability}/Q8.kt (98%) rename src/main/kotlin/{NullAbilityUpdated/Keren => com/hibob/academy/nullability}/Q9.kt (99%) rename src/main/kotlin/{sequence => com/hibob/academy}/omri/SequenceClassEx.kt (98%) rename src/main/kotlin/{Properties/Tamir => com/hibob/academy/properties}/PropertiesTamirClassEx.kt (96%) rename src/main/kotlin/{Basics/Tamir => com/hibob/academy/tamir}/TamirLec01 class exercise.kt (96%) rename src/main/kotlin/{lambda => com/hibob/academy}/yael/lambdaYael.kt (98%) diff --git a/src/main/kotlin/com/hibob/KotlinBasics/extentions.kt b/src/main/kotlin/com/hibob/academy/basics/extentions.kt similarity index 92% rename from src/main/kotlin/com/hibob/KotlinBasics/extentions.kt rename to src/main/kotlin/com/hibob/academy/basics/extentions.kt index 6e832f1b1..3afecbb46 100644 --- a/src/main/kotlin/com/hibob/KotlinBasics/extentions.kt +++ b/src/main/kotlin/com/hibob/academy/basics/extentions.kt @@ -1,4 +1,4 @@ -package com.hibob.KotlinBasics +package com.hibob.academy.basics //Q1 fun List.sum():Int{ var result = 0 diff --git a/src/main/kotlin/Omri/Basics/LoopsOmriLec02.kt b/src/main/kotlin/com/hibob/academy/basicsomri/LoopsOmriLec02.kt similarity index 96% rename from src/main/kotlin/Omri/Basics/LoopsOmriLec02.kt rename to src/main/kotlin/com/hibob/academy/basicsomri/LoopsOmriLec02.kt index 0b6fd30ca..1932373d7 100644 --- a/src/main/kotlin/Omri/Basics/LoopsOmriLec02.kt +++ b/src/main/kotlin/com/hibob/academy/basicsomri/LoopsOmriLec02.kt @@ -1,4 +1,4 @@ -package Omri.Basics +package com.hibob.academy.basicsomri //Omri Solution fun isValidIdentifier(s: String): Boolean { diff --git a/src/main/kotlin/NullAbilityUpdated/Keren/Q1.kt b/src/main/kotlin/com/hibob/academy/nullability/Q1.kt similarity index 94% rename from src/main/kotlin/NullAbilityUpdated/Keren/Q1.kt rename to src/main/kotlin/com/hibob/academy/nullability/Q1.kt index 8e700d7d1..6a09468ec 100644 --- a/src/main/kotlin/NullAbilityUpdated/Keren/Q1.kt +++ b/src/main/kotlin/com/hibob/academy/nullability/Q1.kt @@ -1,4 +1,4 @@ -package NullAbilityUpdated.Keren +package com.hibob.academy.nullability /** * Modify the main function to print each user's email safely. diff --git a/src/main/kotlin/NullAbilityUpdated/Keren/Q2.kt b/src/main/kotlin/com/hibob/academy/nullability/Q2.kt similarity index 92% rename from src/main/kotlin/NullAbilityUpdated/Keren/Q2.kt rename to src/main/kotlin/com/hibob/academy/nullability/Q2.kt index 4774e1565..a7088d60d 100644 --- a/src/main/kotlin/NullAbilityUpdated/Keren/Q2.kt +++ b/src/main/kotlin/com/hibob/academy/nullability/Q2.kt @@ -1,4 +1,4 @@ -package NullAbilityUpdated.Keren +package com.hibob.academy.nullability /** * Modify the main function to calculate and print the sum of all non-null integers in the list numbers. * Use safe calls and/or the Elvis operator where appropriate. diff --git a/src/main/kotlin/NullAbilityUpdated/Keren/Q3.kt b/src/main/kotlin/com/hibob/academy/nullability/Q3.kt similarity index 93% rename from src/main/kotlin/NullAbilityUpdated/Keren/Q3.kt rename to src/main/kotlin/com/hibob/academy/nullability/Q3.kt index 77c4a9e65..6f71d720e 100644 --- a/src/main/kotlin/NullAbilityUpdated/Keren/Q3.kt +++ b/src/main/kotlin/com/hibob/academy/nullability/Q3.kt @@ -1,4 +1,4 @@ -package NullAbilityUpdated.Keren +package com.hibob.academy.nullability /** * Write an extension function nullSafeToUpper() for String? that converts the string * to uppercase if it is not null, or returns "NO TEXT PROVIDED" if it is null. diff --git a/src/main/kotlin/NullAbilityUpdated/Keren/Q4.kt b/src/main/kotlin/com/hibob/academy/nullability/Q4.kt similarity index 96% rename from src/main/kotlin/NullAbilityUpdated/Keren/Q4.kt rename to src/main/kotlin/com/hibob/academy/nullability/Q4.kt index 763969214..d26c98a3a 100644 --- a/src/main/kotlin/NullAbilityUpdated/Keren/Q4.kt +++ b/src/main/kotlin/com/hibob/academy/nullability/Q4.kt @@ -1,4 +1,4 @@ -package NullAbilityUpdated.Keren +package com.hibob.academy.nullability /** * Modify the main function to iterate over the employees list and print each employee's city. * Use safe calls (?.) and the Elvis operator (?:) to ensure that if an employee or their address is null, diff --git a/src/main/kotlin/NullAbilityUpdated/Keren/Q5.kt b/src/main/kotlin/com/hibob/academy/nullability/Q5.kt similarity index 96% rename from src/main/kotlin/NullAbilityUpdated/Keren/Q5.kt rename to src/main/kotlin/com/hibob/academy/nullability/Q5.kt index 59f585d60..09127ba8d 100644 --- a/src/main/kotlin/NullAbilityUpdated/Keren/Q5.kt +++ b/src/main/kotlin/com/hibob/academy/nullability/Q5.kt @@ -1,4 +1,4 @@ -package NullAbilityUpdated.Keren +package com.hibob.academy.nullability /** * Iterate through the list of products. diff --git a/src/main/kotlin/NullAbilityUpdated/Keren/Q6.kt b/src/main/kotlin/com/hibob/academy/nullability/Q6.kt similarity index 97% rename from src/main/kotlin/NullAbilityUpdated/Keren/Q6.kt rename to src/main/kotlin/com/hibob/academy/nullability/Q6.kt index 2214fc153..7d72e3400 100644 --- a/src/main/kotlin/NullAbilityUpdated/Keren/Q6.kt +++ b/src/main/kotlin/com/hibob/academy/nullability/Q6.kt @@ -1,4 +1,4 @@ -package NullAbilityUpdated.Keren +package com.hibob.academy.nullability data class Department(val name: String?, val manager: EmployeeDetails?) data class EmployeeDetails(val name: String?, val contactInfo: ContactInfo?) diff --git a/src/main/kotlin/NullAbilityUpdated/Keren/Q7.kt b/src/main/kotlin/com/hibob/academy/nullability/Q7.kt similarity index 93% rename from src/main/kotlin/NullAbilityUpdated/Keren/Q7.kt rename to src/main/kotlin/com/hibob/academy/nullability/Q7.kt index 767ccce2f..1dc51cb6c 100644 --- a/src/main/kotlin/NullAbilityUpdated/Keren/Q7.kt +++ b/src/main/kotlin/com/hibob/academy/nullability/Q7.kt @@ -1,4 +1,4 @@ -package NullAbilityUpdated.Keren +package com.hibob.academy.nullability /** * @@ -47,6 +47,6 @@ fun List.printAllCustomersDetails(){ } } } - println(Customer(costumerName,Account(accountId,AccountDetails(accountType,accountBalance)))) + println(Customer(costumerName, Account(accountId, AccountDetails(accountType,accountBalance)))) } } diff --git a/src/main/kotlin/NullAbilityUpdated/Keren/Q8.kt b/src/main/kotlin/com/hibob/academy/nullability/Q8.kt similarity index 98% rename from src/main/kotlin/NullAbilityUpdated/Keren/Q8.kt rename to src/main/kotlin/com/hibob/academy/nullability/Q8.kt index 072a745d5..8deba948e 100644 --- a/src/main/kotlin/NullAbilityUpdated/Keren/Q8.kt +++ b/src/main/kotlin/com/hibob/academy/nullability/Q8.kt @@ -1,4 +1,4 @@ -package NullAbilityUpdated.Keren +package com.hibob.academy.nullability /** * Instructions: * diff --git a/src/main/kotlin/NullAbilityUpdated/Keren/Q9.kt b/src/main/kotlin/com/hibob/academy/nullability/Q9.kt similarity index 99% rename from src/main/kotlin/NullAbilityUpdated/Keren/Q9.kt rename to src/main/kotlin/com/hibob/academy/nullability/Q9.kt index 6897634e3..3aebc2846 100644 --- a/src/main/kotlin/NullAbilityUpdated/Keren/Q9.kt +++ b/src/main/kotlin/com/hibob/academy/nullability/Q9.kt @@ -1,4 +1,4 @@ -package NullAbilityUpdated.Keren +package com.hibob.academy.nullability data class DepartmentData(val name: String?, val manager: EmployeeData?) data class EmployeeData(val name: String?, val contactInfo: Contact?) diff --git a/src/main/kotlin/sequence/omri/SequenceClassEx.kt b/src/main/kotlin/com/hibob/academy/omri/SequenceClassEx.kt similarity index 98% rename from src/main/kotlin/sequence/omri/SequenceClassEx.kt rename to src/main/kotlin/com/hibob/academy/omri/SequenceClassEx.kt index 73512b2fc..e303964e7 100644 --- a/src/main/kotlin/sequence/omri/SequenceClassEx.kt +++ b/src/main/kotlin/com/hibob/academy/omri/SequenceClassEx.kt @@ -1,4 +1,4 @@ -package sequence.omri +package com.hibob.academy.omri import org.springframework.cglib.core.Predicate import kotlin.system.exitProcess diff --git a/src/main/kotlin/Properties/Tamir/PropertiesTamirClassEx.kt b/src/main/kotlin/com/hibob/academy/properties/PropertiesTamirClassEx.kt similarity index 96% rename from src/main/kotlin/Properties/Tamir/PropertiesTamirClassEx.kt rename to src/main/kotlin/com/hibob/academy/properties/PropertiesTamirClassEx.kt index 8e2090b01..0090e649b 100644 --- a/src/main/kotlin/Properties/Tamir/PropertiesTamirClassEx.kt +++ b/src/main/kotlin/com/hibob/academy/properties/PropertiesTamirClassEx.kt @@ -1,4 +1,4 @@ -package Properties.Tamir +package com.hibob.academy.properties import java.time.DayOfWeek //1. create class called Store that initlize by day and list of products diff --git a/src/main/kotlin/Basics/Tamir/TamirLec01 class exercise.kt b/src/main/kotlin/com/hibob/academy/tamir/TamirLec01 class exercise.kt similarity index 96% rename from src/main/kotlin/Basics/Tamir/TamirLec01 class exercise.kt rename to src/main/kotlin/com/hibob/academy/tamir/TamirLec01 class exercise.kt index f7e5073cb..1c13c5373 100644 --- a/src/main/kotlin/Basics/Tamir/TamirLec01 class exercise.kt +++ b/src/main/kotlin/com/hibob/academy/tamir/TamirLec01 class exercise.kt @@ -1,4 +1,4 @@ -package Basics.Tamir +package com.hibob.academy.tamir fun main() { //Q1 printHelloWorld() diff --git a/src/main/kotlin/lambda/yael/lambdaYael.kt b/src/main/kotlin/com/hibob/academy/yael/lambdaYael.kt similarity index 98% rename from src/main/kotlin/lambda/yael/lambdaYael.kt rename to src/main/kotlin/com/hibob/academy/yael/lambdaYael.kt index 7c907f854..b2714dff4 100644 --- a/src/main/kotlin/lambda/yael/lambdaYael.kt +++ b/src/main/kotlin/com/hibob/academy/yael/lambdaYael.kt @@ -1,4 +1,4 @@ -package lambda.yael +package com.hibob.academy.yael import java.time.LocalDate @@ -14,7 +14,7 @@ fun main() { } //2. Initiate the variable movie in line 18 with the function createGoodMovie() -val createGoodMovie :() -> SpidermanNoWayHome = { SpidermanNoWayHome()} +val createGoodMovie :() -> SpidermanNoWayHome = { SpidermanNoWayHome() } fun printSuccessMessage(success: Boolean) { if (success) { From 514acd902c4d7438b5c9e255ccc9c148b44fae80 Mon Sep 17 00:00:00 2001 From: Ron Azar Date: Mon, 16 Sep 2024 11:31:03 +0300 Subject: [PATCH 5/5] Instead of defining all parameters you can define them directly here private val user = User(123,"Ron Azar", "ron.azar@hibob.io" ,"12345", true) --- .../com/hibob/academy/unitests/keren/UserServiceTest.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/test/kotlin/com/hibob/academy/unitests/keren/UserServiceTest.kt b/src/test/kotlin/com/hibob/academy/unitests/keren/UserServiceTest.kt index 392837c86..7f787cdfc 100644 --- a/src/test/kotlin/com/hibob/academy/unitests/keren/UserServiceTest.kt +++ b/src/test/kotlin/com/hibob/academy/unitests/keren/UserServiceTest.kt @@ -11,12 +11,8 @@ import org.mockito.kotlin.* class UserServiceTest{ val token = "Waffle" val id: Long= 123 - val name: String = "Ron Azar" - val email: String = "ron.azar@hibob.io" - val password: String ="12345" - val isEmailValid = true - private val user = User(id,name, email ,password, isEmailValid) + private val user = User(123,"Ron Azar", "ron.azar@hibob.io" ,"12345", true) private val userDao= mock{} private val notificationService= mock{} private val emailVerificationService= mock{}