In my play application i intend to mock a case class. I am able to do so but it creates an object with all member variables null. Is there a way to create mock objects of a case classes such that the object can have some members initialized?
case class User(name: String, address: String)
val mockUser = mock[User]
user.name // null
user.address //null
how do i create a mockUser such that i can assign some values to name and address?
Edit:
I need the ability to mock the object because i want to have predefined behavior of one of the member method. (This member method calls an external service and i dont want the external service call while doing a unit test.) The member method is called inside another member method, which i want to test.