I have a class as follows:
public class MyClass{
Connector con;
public MyClass(Connector con){
this.con= con;
}
public void save(Xyz xyz){
//save 2 instances of xyz one with lastupdatetime as 0 and other with
// currenttimestamp
xyz.setLastUpdateTime(0) ; a
con.save(xyz) ;
xyz.setLastUpdateTime(Calender.getInstance().getCurrentTimeInMillis() );
con.save(xyz);
}
}
How can i write test case of it using easymock.
The problem is that the time stamp is found by the method at runtime. And its different from one in mocked object.Can i ignore specific param of Xyz class
What can i specify to ignore specific attribute while mocking?
Easymock.expect(con.save(xyz)).andReturn(something) ??