// However, it's not part of the official API so not necessary to assert it.
@Test(description = "test completed task not included in vAppTemplate")
public void testCompletedTaskNotIncludedInVAppTemplate() throws Exception {
// Kick off a task, and wait for it to complete
vAppTemplateApi.disableDownload(vAppTemplateUrn);
final Task task = vAppTemplateApi.enableDownload(vAppTemplateUrn);
assertTaskDoneEventually(task);
// Ask the VAppTemplate for its tasks, and the status of the matching task if it exists
VAppTemplate vAppTemplate = vAppTemplateApi.get(vAppTemplateUrn);
List<Task> tasks = vAppTemplate.getTasks();
for (Task contender : tasks) {
if (task.getId().equals(contender.getId())) {
Task.Status status = contender.getStatus();
if (EnumSet.of(Task.Status.QUEUED, Task.Status.PRE_RUNNING, Task.Status.RUNNING).contains(status)) {
fail("Task " + contender + " reported complete, but is included in VAppTemplate in status " + status);
}
}