@Test
public void testTriggerInstanceCancelledStatus() throws Exception {

  final List<DependencyInstance> dependencyInstanceList = new ArrayList<>();
  TriggerInstance ti = null;
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.CANCELLED, CancellationCause.MANUAL));
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.CANCELLED, CancellationCause.MANUAL));
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.SUCCEEDED, CancellationCause.NONE));
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.SUCCEEDED, CancellationCause.NONE));
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.SUCCEEDED, CancellationCause.NONE));
  ti = new TriggerInstance("1", null, "1", 1,
      "test", dependencyInstanceList, -1, null);
  assertThat(ti.getStatus()).isEqualTo(Status.CANCELLED);
  dependencyInstanceList.clear();
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.CANCELLED, CancellationCause.MANUAL));
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.CANCELLED, CancellationCause.MANUAL));
  ti = new TriggerInstance("1", null, "1", 1,
      "test", dependencyInstanceList, -1, null);
  assertThat(ti.getStatus()).isEqualTo(Status.CANCELLED);
  dependencyInstanceList.clear();
}