It seams that you misunderstood the concept of mocking in tests.
Assume you have a class A
and a class B
. Class A
has a method mA()
, that uses the method mB()
from Class B for its functionality.
If you now want to test mA()
, then mA()
will invoke mB()
. In most cases this is not a problem, but assume Class B
is a DAO and mB()
is some function that will query the Database. Then you will need a Database in order to test mA()
. Now assume that you have already tests mB()
and you only want to test mA()
. So you can replace B
by a mock B´
, that "simulates" mB()
.
In your case, B
is TestDao
/TestDaoImpl
. So if you want to mock TestDao
, so you need someting else (A
) to test, because you can not test the mocked class!