Thanks for the reply, I did the same steps as you explained. I get this error, when I test the GameManagerImplTest.
public class GameManagerImpl extends GameManager{ public Game autoPlay() { //..... Move move = moveDao.getBestMove(); //..... } } public class GameManagerImplTest extends BaseManagerMockTestCase{ public void testAutoPlay() { Game game = manager.autoPlay(); assertNotNull(game); } } When I run the testAutoPlay, it gives the following error. manager.getMoveDao() returns not null. so there must be no wiring problem. org.jmock.core.DynamicMockError: mockMoveDao: unexpected invocation Invoked: mockMoveDao.getBestMove() Allowed: No expectations set at org.jmock.core.AbstractDynamicMock.mockInvocation(AbstractDynamicMock.java:95) at org.jmock.core.CoreMock.invoke(CoreMock.java:39) at $Proxy2.getByCode(Unknown Source) at org.ob.service.impl.GameManagerImpl.autoPlay(GameManagerImpl.java:44) at org.ob.service.impl.GameManagerImpl.autoPlay(GameManagerImpl.java:32) at org.ob.service.impl.GameManagerImplTest.testAutoPlay(GameManagerImplTest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.jmock.core.VerifyingTestCase.runBare(VerifyingTestCase.java:39) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32) -- View this message in context: http://www.nabble.com/-Appfuse2.0--Best-Practise-Design-Pattern-for-Multiple-Dao-Access-from-managers-tp14116309s2369p14370251.html Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]