@Override
  public void removeTaskDef(String name) {
    LOG.info("Removing a task definition with name {}", name);
    withMetricLogError(
        () -> {
          int cnt =
              withRetryableUpdate(
                  REMOVE_TASK_DEFINITIONS_STATEMENT, statement -> statement.setString(1, name));
          if (cnt != 1) {
            throw new ApplicationException(
                ApplicationException.Code.NOT_FOUND,
                "Cannot remove the task - no such task definition with name " + name);
          }
          return cnt;
        },
        "removeTaskDef",
        "Failed removing a task definition with name {}",
        name);
  }
@Test(expected = ApplicationException.class)
  public void testRemoveTaskDef() throws Exception {
    dao.removeTaskDef("test" + UUID.randomUUID().toString());
  }