@Test
public void testProcessTermination() throws Exception {

  final TriggerInstance triggerInstance = createTriggerInstance();
  this.processor.processTermination(triggerInstance);
  this.sendEmailLatch.await(10L, TimeUnit.SECONDS);
  assertEquals(0, this.sendEmailLatch.getCount());
  verify(this.message).setSubject(
      "flow trigger for flow 'flowId', project 'proj' has been cancelled on azkaban");
  assertThat(TestUtils.readResource("/emailTemplate/flowtriggerfailureemail.html", this))
      .isEqualToIgnoringWhitespace(this.message.getBody());
}