@Test
public void testShouldDaosBeCalledWithTheCleanupPolicy() throws Exception {

  // GIVEN
  cleanables = new HashSet<>();
  cleanables.add(cleanableDao);
  expect(cleanableDao.cleanup(capture(timeBasedCleanupPolicyCapture))).andReturn(2L);
  replay(cleanableDao);
  cleanupServiceImpl = new CleanupServiceImpl(cleanables);
  // WHEN
  long rows = cleanupServiceImpl.cleanup(cleanupPolicy);
  // THEN
  Assert.assertNotNull("The argument is null", timeBasedCleanupPolicyCapture.getValue());
  Assert.assertEquals("The cluster name is wrong!", timeBasedCleanupPolicyCapture.getValue().getClusterName(), CLUSTER_NAME);
  Assert.assertEquals("The to date is wrong!", timeBasedCleanupPolicyCapture.getValue().getToDateInMillis(), FROM_DATE_TIMESTAMP);
}