RedisMetadataDAO extends BaseDynoDAO implements MetadataDAO { @Override public void removeTaskDef(String name) { Preconditions.checkNotNull(name, "TaskDef name cannot be null"); Long result = dynoClient.hdel(nsKey(ALL_TASK_DEFS), name); if (!result.equals(1L)) { throw new ApplicationException(Code.NOT_FOUND, "Cannot remove the task - no such task definition"); } recordRedisDaoRequests("removeTaskDef"); refreshTaskDefs(); } @Inject  RedisMetadataDAO(DynoProxy dynoClient, ObjectMapper objectMapper, Configuration config); @Override void createTaskDef(TaskDef taskDef); @Override String updateTaskDef(TaskDef taskDef); @Override TaskDef getTaskDef(String name); @Override List<TaskDef> getAllTaskDefs(); @Override void removeTaskDef(String name); @Override void createWorkflowDef(WorkflowDef def); @Override void updateWorkflowDef(WorkflowDef def); @Override /* * @param name Name of the workflow definition * @return Latest version of workflow definition * @see WorkflowDef */ Optional<WorkflowDef> getLatestWorkflowDef(String name); List<WorkflowDef> getAllVersions(String name); @Override Optional<WorkflowDef> getWorkflowDef(String name, int version); @Override void removeWorkflowDef(String name, Integer version); List<String> findAll(); @Override List<WorkflowDef> getAllWorkflowDefs();  }
@Test(expected = ApplicationException.class) public void testRemoveTaskDef() { redisMetadataDAO.removeTaskDef("test" + UUID.randomUUID().toString()); }