@Test
public void alertOnFailedUpdate() throws Exception {

  final Flow flow = this.project.getFlow("jobe");
  flow.addFailureEmails(this.receiveAddrList);
  Assert.assertNotNull(flow);
  final ExecutableFlow exFlow = new ExecutableFlow(this.project, flow);
  final CommonMetrics commonMetrics = new CommonMetrics(new MetricsManager(new MetricRegistry()));
  final Emailer emailer = new Emailer(this.props, commonMetrics, this.messageCreator,
      this.executorLoader);
  final Executor executor = new Executor(1, "executor1-host", 1234, true);
  final List<ExecutableFlow> executions = Arrays.asList(exFlow, exFlow);
  final ExecutorManagerException exception = DefaultMailCreatorTest.createTestStracktrace();
  emailer.alertOnFailedUpdate(executor, executions, exception);
  verify(this.message).addAllToAddress(this.receiveAddrList);
  verify(this.message)
      .setSubject("Flow status could not be updated from executor1-host on azkaban");
  assertThat(TestUtils.readResource("failedUpdateMessage2.html", this))
      .isEqualToIgnoringWhitespace(this.message.getBody());
}