@Test
public void testDelete() throws Exception {

  Date before = new Date(now.getTime() - 5000);
  Sample sample = new Sample();
  sample.setSampleId(100L);
  sample.setName("Foo");
  sample.setUpdateSequence(13);
  sample.setUpdateTime(before);
  sampleDao.deleteSample(sample, 23L);
  // Verify object in memory is updated properly
  assertEquals(new Long(100L), sample.getSampleId());
  assertEquals("Foo", sample.getName());
  assertEquals(new Integer(14), sample.getUpdateSequence());
  assertEquals(now, sample.getUpdateTime());
  // Verify database queries against golden copies
  verify(db).update(anyString(), eq("delete from sample where sample_id=100"));
  verify(db).insert(eq("insert into sample_history (sample_id, sample_name, update_sequence, update_time, update_user_id, is_deleted) values (?,?,?,?,?,'Y')"), anyString());
  verifyNoMoreInteractions(db);
}