I am writing test case in testNg and mockito. I got stuck at this line in a method –
MyClass myClass = new MyClass(new OtherClass());
I want to initialize myClass with Mockito.mock(MyClass.class) mocked object.
Is there any solution for this?
I tried to resolve all the dependencies but that will give me a real object in MyClass. I want to have a mocked object.
New contributor
Aman Mishra is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.