Can some help me to mock AnotherClass object.
Things I have tried so far.
Powermockito we can not use for some reason.
ClassToBeTested {
@Autowired
DependencyOne dep1;
@Autowired
DependencyTwo dep2;
method(){
AnotherClass anotherClass = new AnotherClass(dep1,dep2);
anotherClass.someAction();
}
}
I was able to handle this scenario by letting the call go to Another Class and then mocking the code present in some action()
method with when then statements.