Class A: Class being tested. Class A extends class B and overrides its method common().
i.e.
class B {
fun common() {}
}
class A : B {
override fun common() {
if(x) {
doSomething()
} else
super.common() }
}
Now if you are testing class A’s common() method, how will you verify that it is calling super.common() from within?
Unit tests are supposed to verify the
effect of code. A very simple, generic and non-working, example isThus, I suppose your
commondoes something indoSomething. This is what you test. If your common method would not do anything - it cannot be tested.Your question is not complete in this aspect, so it cannot be answered more precisely at this moment.