My java project has multiple layers such as Controller (depends on) Service (depends on) DAO. My goal is to unit test Controller.
I created Mock service object to inject it in to Controller class.
After googling , Ive learnt that I could use java interface to do so.
Ideally, service layer does not need an interface.
I wonder if there is a different approach to inject mock object without a java interface.