### Question:
JobServiceManager { @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public JobService create(String referential, String action, String type, Map<String, InputStream> inputStreamsByName) throws ServiceException { validateReferential(referential); synchronized (lock) { if (scheduler.getActivejobsCount() >= maxJobs) { throw new RequestServiceException(RequestExceptionCode.TOO_MANY_ACTIVE_JOBS, "" + maxJobs + " active jobs"); } JobService jobService = jobServiceManager.createJob(referential, action, type, inputStreamsByName); scheduler.schedule(referential); return jobService; } }  @PostConstruct synchronized void init(); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) JobService create(String referential, String action, String type, Map<String, InputStream> inputStreamsByName); List<Stat> getMontlyStats(); JobService createJob(String referential, String action, String type,
			Map<String, InputStream> inputStreamsByName); List<TestDescription> getTestList(String action, String type); JobService download(String referential, Long id, String filename); JobService getNextJob(String referential); void start(JobService jobService); JobService cancel(String referential, Long id); void remove(String referential, Long id); void drop(String referential); void terminate(JobService jobService); void abort(JobService jobService); List<JobService> findAll(); List<JobService> findAll(String referential); JobService scheduledJob(String referential, Long id); JobService terminatedJob(String referential, Long id); JobService getJobService(Long id); List<JobService> jobs(String referential, String action[], final Long version, Job.STATUS[] status); List<JobService> activeJobs(); static final String BEAN_NAME; }### Answer:
@Test(groups = { "JobServiceManager" }, description = "Check wrong referential") public void createWrongJobReferential() { String referential = "toto"; String action = "action"; String type = "type"; Map<String, InputStream> inputStreamsByName = null; try { jobServiceManager.create(referential, action, type, inputStreamsByName); } catch (RequestServiceException e) { Assert.assertEquals(e.getCode(), ServiceExceptionCode.INVALID_REQUEST.name(), "code expected"); Assert.assertEquals(e.getRequestCode(), RequestExceptionCode.UNKNOWN_REFERENTIAL.name(), "request code expected"); return; } catch (Exception e) { Assert.assertTrue(false, "RequestServiceException required"); } Assert.assertTrue(false, "exception required"); }
@Test(groups = { "JobServiceManager" }, description = "Check wrong action") public void createWrongJobAction() { String referential = "chouette_gui"; String action = "action"; String type = "type"; Map<String, InputStream> inputStreamsByName = new HashMap<>(); try { jobServiceManager.create(referential, action, type, inputStreamsByName); } catch (RequestServiceException e) { Assert.assertEquals(e.getCode(), ServiceExceptionCode.INVALID_REQUEST.name(), "code expected"); Assert.assertEquals(e.getRequestCode(), RequestExceptionCode.UNKNOWN_ACTION.name(), "request code expected"); return; } catch (Exception e) { Assert.assertTrue(false, "RequestServiceException required," + e.getClass().getName() + " received"); } Assert.assertTrue(false, "exception required"); }