Computing with Data

elgeish
82.6K views

Test Hooks - Part I

For example, if we want to record the timestamp at which a reminder is inserted in the database, we need to control what value is sent to the database at the time of insertion. The below example shows an incomplete way of verifying the behavior:

import org.easymock.EasyMock;
import org.testng.annotations.Test;
interface DataLayer {
void insertReminder(
final Reminder reminder, long creationTimestampInMillis);
}
class Reminder {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX