@Test
public void testCallableServiceShouldExitWhenTaskCompleted() throws Exception {

  // GIVEN
  // the task to be executed never completes successfully
  expect(taskMock.call()).andReturn(Boolean.TRUE).times(1);
  replayAll();
  asyncCallableService = new AsyncCallableService<>(taskMock, timeout, delay, Executors.newScheduledThreadPool(2));
  // WHEN
  Boolean serviceResult = asyncCallableService.call();
  // THEN
  verify();
  Assert.assertNotNull("Service result must not be null", serviceResult);
  Assert.assertTrue(serviceResult);
}