@Test
public void issueSYNCOPE81() {
String sender = createNotificationTask();
NotificationTaskTO taskTO = findNotificationTaskBySender(sender);
assertNotNull(taskTO);
int executions = taskTO.getExecutions().size();
if (executions == 0) {
// generate an execution in order to verify the deletion of a notification task with one or more executions
TaskExecTO execution = taskService.execute(taskTO.getId(), false);
assertEquals("NOT_SENT", execution.getStatus());
int i = 0;
int maxit = 50;
// wait for task exec completion (executions incremented)
do {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
taskTO = taskService.read(TaskType.NOTIFICATION, taskTO.getId());
assertNotNull(taskTO);
assertNotNull(taskTO.getExecutions());
i++;
} while (executions == taskTO.getExecutions().size() && i < maxit);
assertFalse(taskTO.getExecutions().isEmpty());
}
taskService.delete(taskTO.getId());
}