### Question:
MySQLMetadataDAO extends MySQLBaseDAO implements MetadataDAO, EventHandlerDAO { @Override public void removeTaskDef(String name) { final String DELETE_TASKDEF_QUERY = "DELETE FROM meta_task_def WHERE name = ?"; executeWithTransaction(DELETE_TASKDEF_QUERY, q -> { if (!q.addParameter(name).executeDelete()) { throw new ApplicationException(ApplicationException.Code.NOT_FOUND, "No such task definition"); } taskDefCache.remove(name); }); } @Inject  MySQLMetadataDAO(ObjectMapper om, DataSource dataSource, 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 Optional<WorkflowDef> getLatestWorkflowDef(String name); @Override Optional<WorkflowDef> getWorkflowDef(String name, int version); @Override void removeWorkflowDef(String name, Integer version); List<String> findAll(); @Override List<WorkflowDef> getAllWorkflowDefs(); List<WorkflowDef> getAllLatest(); List<WorkflowDef> getAllVersions(String name); @Override void addEventHandler(EventHandler eventHandler); @Override void updateEventHandler(EventHandler eventHandler); @Override void removeEventHandler(String name); @Override List<EventHandler> getAllEventHandlers(); @Override List<EventHandler> getEventHandlersForEvent(String event, boolean activeOnly); static final String PROP_TASKDEF_CACHE_REFRESH; static final int DEFAULT_TASKDEF_CACHE_REFRESH_SECONDS; }### Answer:
@Test(expected=ApplicationException.class) public void testRemoveTaskDef() throws Exception { dao.removeTaskDef("test" + UUID.randomUUID().toString()); }