### Question:
Jobs { public void delete(Job job, ACS acs) throws SQLException { if (!acs.getUser().isUnittypeAdmin(unittype.getId())) { throw new IllegalArgumentException("Not allowed action for this user"); } deleteJobParameters(job, acs); Connection c = null; PreparedStatement pp = null; SQLException sqle; try { c = acs.getDataSource().getConnection(); String sql = "DELETE FROM job WHERE job_id = ?"; pp = c.prepareStatement(sql); pp.setInt(1, job.getId()); pp.setQueryTimeout(60); pp.execute(); removeJobFromDataModel(job); logger.info("Deleted job " + job.getId()); if (acs.getDbi() != null) { acs.getDbi().publishDelete(job, job.getGroup().getUnittype()); } } catch (SQLException sqlex) { sqle = sqlex; throw sqle; } finally { if (pp != null) { pp.close(); } if (c != null) { c.close(); } } } Jobs(Map<Integer, Job> idMap, Map<String, Job> nameMap, Unittype unittype); void addOrChangeJobParameters(List<JobParameter> jobParameters, ACS acs); void deleteJobParameters(Job job, ACS acs); int deleteJobParameters(List<JobParameter> jobParameters, ACS acs); void delete(Job job, ACS acs); List<Job> getAllowedDependencies(Job job); void add(Job job, ACS acs); Map<String, JobParameter> readJobParameters(Job job, Unit unit, ACS acs); void changeFromCore(Job job, String publishMsg, ACS acs); void changeStatus(Job job, ACS acs); int changeFromUI(Job job, ACS acs); Job[] getGroupJobs(Integer groupId); Job[] getJobs(); Job getByName(String jobName); Job getById(Integer jobId); Unittype getUnittype();  }### Answer:
@Test public void delete() throws SQLException { String unitId = "YidduJb7sssC"; String unittypeName = "Test unittype"; String groupName = "Group"; String profileName = "Default"; String jobName = "Job"; JobFlag jobFlag = new JobFlag("CONFIG|REGULAR"); String jobDesc = "Description"; Unittype unittype = TestUtils.createUnittype(unittypeName, acs); Profile profile = unittype.getProfiles().getByName(profileName); ACSUnit acsUnit = new ACSUnit(dataSource, acs, syslog); TestUtils.createUnitAndVerify(acsUnit, unitId, profile); Group group = TestUtils.createGroupAndVerify(groupName, profileName, unittype, acs); Job job = TestUtils.createJobAndVerify(jobName, jobFlag, jobDesc, unittype, group, acs); unittype.getJobs().delete(job, acs); assertNull(unittype.getJobs().getByName(jobName)); }