Reputation: 1530
I have an abstract base class (parent) and a derived class (child)
public class child extend parent{
public void child(...) {
super(..)
}
}
public abstract class parent{
.
.
.
}
Here I want to test a public method in child class. And I don't have any dependency in parent class. so I want to mock my abstract parent class. Couldn't find any solid example of doing it. Please share your suggestion.
Upvotes: 3
Views: 1190
Reputation: 32959
You cannot do this. child
is a subclass of parent
. You cannot change this. The best you can do is mock all dependancies in parent
.
Upvotes: 2