JobServiceImpl extends WaspMessageHandlingServiceImpl implements JobService { @Override public LinkedHashMap<String, String> getExtraJobDetails(Job job){ Assert.assertParameterNotNull(job, "No Job provided"); Assert.assertParameterNotNullNotZero(job.getId(), "Invalid Job Provided"); LinkedHashMap<String, String> extraJobDetailsMap = new LinkedHashMap<String, String>(); List<JobResourcecategory> jobResourceCategoryList = job.getJobResourcecategory(); String area = null; for(JobResourcecategory jrc : jobResourceCategoryList){ if(jrc.getResourceCategory().getResourceType().getIName().equals("mps") || jrc.getResourceCategory().getResourceType().getIName().equals("bioanalyzer")){ extraJobDetailsMap.put("jobdetail_for_import.Machine.label", jrc.getResourceCategory().getName()); area = jrc.getResourceCategory().getIName(); break; } } for(JobMeta jobMeta : job.getJobMeta()){ String strRunType = area+".runType"; String strReadType = area+".readType"; String strReadLength = area+".readLength"; String bioanalyzerChip = area+".chip"; String bioanalyzerAssayLibrariesAreFor = area+".assayLibrariesAreFor"; if(strRunType.toLowerCase().equals(jobMeta.getK().toLowerCase().trim())){ extraJobDetailsMap.put("jobdetail_for_import.Run_Type.label", jobMeta.getV()); } else if(strReadType.toLowerCase().equals(jobMeta.getK().toLowerCase().trim())){ extraJobDetailsMap.put("jobdetail_for_import.Read_Type.label", jobMeta.getV()); } else if(strReadLength.toLowerCase().equals(jobMeta.getK().toLowerCase().trim())){ extraJobDetailsMap.put("jobdetail_for_import.Read_Length.label", jobMeta.getV()); } else if(bioanalyzerChip.toLowerCase().equals(jobMeta.getK().toLowerCase().trim())){ extraJobDetailsMap.put("jobdetail_for_import.Bioanalyzer_Chip.label", jobMeta.getV()); } else if(bioanalyzerAssayLibrariesAreFor.toLowerCase().equals(jobMeta.getK().toLowerCase().trim())){ extraJobDetailsMap.put("jobdetail_for_import.Bioanalyzer_AssayLibrariesAreFor.label", jobMeta.getV()); } } return extraJobDetailsMap; }  @Override @Autowired void setJobDao(JobDao jobDao); @Override JobDao getJobDao(); @Autowired void setJobMetaDao(JobMetaDao jobMetaDao); @Override JobMetaDao getJobMetaDao(); void setJobSoftwareDao(JobSoftwareDao jobSoftwareDao); void setJobResourcecategoryDao(JobResourcecategoryDao jobResourcecategoryDao); void setJobSampleDao(JobSampleDao jobSampleDao); @Override JobSampleDao getJobSampleDao(); void setSampleDao(SampleDao sampleDao); void setRoleDao(RoleDao roleDao); void setJobUserDao(JobUserDao jobUserDao); void setLabDao(LabDao labDao); void setJobCellSelectionDao(JobCellSelectionDao jobCellSelectionDao); void setSampleJobCellSelectionDao(SampleJobCellSelectionDao sampleJobCellSelectionDao); void setWorkflowDao(WorkflowDao workflowDao); void setJobDraftDao(JobDraftDao jobDraftDao); void setSampleMetaDao(SampleMetaDao sampleMetaDao); void setSampleService(SampleService sampleService); void setSampleTypeDao(SampleTypeDao sampleTypeDao); void setLogger(Logger logger); JobDraftService getJobDraftService(); void setJobDraftService(JobDraftService jobDraftService); @Override Job getJobByJobId(Integer jobId); @Override @Transactional(value="entityManager", propagation=Propagation.REQUIRES_NEW) Job getJobByJobIdInDiscreteTransaction(Integer jobId); @Override List<Sample> getSubmittedSamples(Job job); @Override List<Sample> getSubmittedSamplesNotYetReceived(Job job); @Override List<Sample> getSubmittedSamplesNotYetQC(Job job); @Override List<Sample> getLibrariesNotYetQC(Job job); @Override List<Job> getActiveJobs(); @Override boolean isJobActive(Job job); @Override List<Job> getJobsAwaitingReceivingOfSamples(); @Override boolean isJobsAwaitingReceivingOfSamples(List<Job> activeJobs); @Override boolean isJobAwaitingReceivingOfSamples(Job job); @Override boolean isJobAwaitingCellLibraryQC(Job job); @Override boolean isJobsAwaitingCellLibraryQC(List<Job> jobs); @Override List<Job> getJobsAwaitingFmApproval(); @Override List<Job> getJobsAwaitingPiLmApproval(); @Override List<Job> getJobsAwaitingDaApproval(); @Override List<Job> getJobsAwaitingSampleQC(); @Override boolean isJobAwaitingSampleQC(Job job); @Override boolean isJobsAwaitingSampleQC(List<Job> jobs); @Override List<Job> getJobsAwaitingLibraryQC(); @Override boolean isJobsAwaitingLibraryQC(List<Job> jobs); @Override boolean isJobAwaitingLibraryQC(Job job); @Override void sortJobsByJobId(List<Job> jobs); @Override boolean isJobAwaitingPiApproval(Job job); @Override boolean isJobAwaitingDaApproval(Job job); @Override boolean isJobAwaitingFmApproval(Job job); @Override boolean isJobPendingApprovalOrQuote(Job job); @Override boolean isJobAwaitingQuote(Job job); @Override List<Job> getJobsAwaitingQuote(); @Override boolean isJobsAwaitingQuote(List<Job> activeJobs); @Override LinkedHashMap<String, String> getExtraJobDetails(Job job); @Override LinkedHashMap<String, String> getJobApprovals(Job job); @Override Job createJobFromJobDraft(JobDraft jobDraft, User user); @Override void initiateBatchJobForJobSubmission(Job job); @Override List<Job> getJobsAwaitingLibraryCreation(); @Override boolean isJobAwaitingLibraryCreation(Job job); @Override List<Job> getJobsWithLibrariesToGoOnPlatformUnit(ResourceCategory resourceCategory); @Override List<Job> getJobsWithLibrariesToGoOnPlatformUnit(); @Override boolean isJobWithLibrariesToGoOnPlatformUnit(Job job); @Override List<Sample> getPlatformUnitWithLibrariesOnForJob(Job job); @Override List<Job> getJobsSubmittedOrViewableByUser(User user); @Override boolean isJobAwaitingLibraryCreation(Job job, Sample sample); @Override void updateJobQuoteStatus(Job job, WaspStatus status); @Override void updateJobApprovalStatus(String jobApproveCode, Job job, WaspStatus status, String comment); @Override void updateJobDaApprovalStatus(Job job, WaspStatus status, String comment); @Override void updateJobPiApprovalStatus(Job job, WaspStatus status, String comment); @Override void updateJobFmApprovalStatus(Job job, WaspStatus status, String comment); @Override void addJobViewer(Integer jobId, String newViewerEmailAddress); @Override void removeJobViewer(Integer jobId, Integer userId); @Override void setFacilityJobComment(Integer jobId, String comment); @Override List<MetaMessage> getAllFacilityJobComments(Integer jobId); @Override void setUserSubmittedJobComment(Integer jobId, String comment); @Override List<MetaMessage> getUserSubmittedJobComment(Integer jobId); @Override Map<Sample, String> getCoverageMap(Job job); @Override void setJobDao(SampleDao mockSampleDao); @Override WaspJobContext getWaspJobContext(Job job); @Override void setJobApprovalComment(String jobApproveCode, Integer jobId, String comment); @Override List<MetaMessage> getJobApprovalComments(String jobApproveCode, Integer jobId); @Override HashMap<String, MetaMessage> getLatestJobApprovalsComments(Set<String> jobApproveCodeSet, Integer jobId); @Override Map<String, Object> getTreeViewBranch(Integer id, Integer pid, String type, Integer jid); @Override LinkedHashMap<String, Object> getJobDetailWithMeta(int jobId); @Override String getJobStatusComment(Job job); @Override String getDetailedJobStatusString(Job job); @Override List<Software> getSoftwareForJob(Job job); @Override boolean isQcPerformedOrPreprocessingFailedForAtLeastOneCellLibraryForAllSubmittedSamples(Job job); @Override boolean isAnySampleCurrentlyBeingProcessed(Job job); @Override void initiateAggregationAnalysisBatchJob(Job job); @Override JobDataTabViewing getTabViewPluginByJob(Job job); @Override List<Job> getActiveJobsWithNoSamplesCurrentlyBeingProcessed(); boolean isAggregationAnalysisBatchJob(Job job); @Override ExitStatus getJobStatus(Job job); @Override boolean isTerminated(Job job); @Override boolean isFinishedSuccessfully(Job job); @Override void terminate(Job job); @Override void setJobApprovalStatusAndComment(String jobApproveCode, Job job, WaspStatus status, String comment); @Override void addNewQuote(Integer jobId, AcctQuote quoteForm, List<AcctQuoteMeta> metaList); @Override Job getJobAndSoftware(Job job); @Override List<Sample> getLibraries(Job job); @Override FileGroup createNewQuoteAndSaveQuoteFile(MPSQuote mpsQuote, File file, Float totalFinalCost, boolean saveQuoteAsJSON); @Override FileGroup createNewQuoteOrInvoiceAndUploadFile(Job job, MultipartFile mpFile, String fileDescription, Float totalCost); @Override Strategy getStrategy(String strategyType, Job job); @Override List<JobMeta> getJobMeta(Integer jobId); @Override List<List<Sample>> getSampleReplicates(Job job); @Override boolean getIsAnalysisSelected(Job job); @Override List<String> getAllPossibleJobStatusAsString(); @Override boolean updateJobAnalysisSelected(Job job, boolean analysisSelected, List<Integer> softwareIdList); Date getJobCompletionDate(Job job); static final String SAMPLE_PAIR_META_KEY; }
@Test public void getExtraJobDetails5() { try { jobServiceImpl.getExtraJobDetails(null); } catch (InvalidParameterException e){ Assert.assertEquals(e.getMessage(), "No Job provided"); } try { Job job = new Job(); jobServiceImpl.getExtraJobDetails(job); } catch (InvalidParameterException e){ Assert.assertEquals(e.getMessage(), "Invalid Job Provided"); } }