Hi,
I am using easymock to
test the controller in my Spring project. I am getting an object back (obj1) which is of the same type as obj but none of its properties are set. Here is the partial code:
controller= new ObjController();
objService= org.easymock.EasyMock.createNiceMock(objService.class);
controller.setObjService(objService);
expect(objService.saveObj(obj)).andReturn(obj1);
replay(objService);
obj1 = (Obj) controller.create(obj);
My service create method:
@RequestMapping
public @ResponseBody
Obj create(@ModelAttribute("object") Obj obj) {
....
return objService.saveObj(obj);
}
Any ideas why I am not getting the obj1 set?
Thanks!!