easymock « dao « Java Database Q&A





1. Unit testing DAO, am I doing it right?    stackoverflow.com

I'm starting out unit testing and reviewing Java web programming. The thing is I don't know if I'm doing things right. I'm building a mini blog. I'm using EasyMock for the ...

2. EasyMock returns Null for Expected Method    stackoverflow.com

I have am having a problem with EasyMock returning null for an expected (defined) method call. Creation of the mocked Object

mock = EasyMock.createMock(DAO.class);
Mock Set up in unit test.
expect(mock.update(myObj).andReturn(myObjUpdated).once();
replayAll();
service.setDao(mock);
service.processData(myObj);
verifyAll();
processData method simply calls
MyObject ...