@Test(expectedExceptions = IllegalArgumentException.class)
public void testTaskExecutorConfShouldThrowException() throws Exception {

  TaskExecutor taskExecutor = new TaskExecutor();
  Configuration tonyConf = new Configuration(false);
  tonyConf.setInt(TonyConfigurationKeys.TASK_HEARTBEAT_INTERVAL_MS, 2000);
  File confFile = new File(System.getProperty("user.dir"), Constants.TONY_FINAL_XML);
  try (OutputStream os = new FileOutputStream(confFile)) {
    tonyConf.writeXml(os);
  }
  if (!confFile.delete()) {
    throw new RuntimeException("Failed to delete conf file");
  }
  // Should throw exception since we didn't set up Task Command.
  taskExecutor.initConfigs();
}