@Test
public void testKillRunningFlow() throws Exception {

  // Flow2 is assigned to executor2 and is in RUNNING status.
  submitFlow(this.flow2, this.ref2);
  this.flow2.setStatus(Status.RUNNING);
  this.controller.cancelFlow(this.flow2, this.user.getUserId());
  // Verify that executor is called to cancel flow2.
  verify(this.apiGateway).callWithReferenceByUser(this.ref2, ConnectorParams.CANCEL_ACTION,
      this.user.getUserId());
}