StudyServiceImpl implements StudyService { @Override public Study findBySWAccession(Integer swAccession) { Study study = null; if (swAccession != null) { try { study = studyDAO.findBySWAccession(swAccession); } catch (Exception exception) { LOG.error("Cannot find Study by swAccession " + swAccession); LOG.error(exception.getMessage()); } } return study; } StudyServiceImpl(); @Override void setStudyDAO(StudyDAO studyDAO); void setFileDAO(FileDAO fileDAO); @Override Integer insert(Study study); @Override void update(Study study); @Override void merge(Study study); @Override void delete(Study study, boolean deleteRealFiles); @Override List<File> getFiles(Integer studyId); @Override boolean isHasFile(Integer studyId); @Override List<File> getFiles(Integer studyId, String metaType); @Override boolean isHasFile(Integer studyId, String metaType); @Override List<Study> list(Registration registration); @Override List<Study> list(Registration registration, Boolean isAcs); @Override List<Study> listMyShared(Registration registration, Boolean isAcs); @Override List<Study> listSharedWithMe(Registration registration); @Override List<Study> listSharedWithMe(Registration registration, Boolean isAcs); @Override List<Study> findByTitle(String title); @Override Study findByID(Integer studyID); @Override Study findBySWAccession(Integer swAccession); @Override List<Study> findByOwnerID(Integer registrationId); @Override List<Study> findByCriteria(String criteria, boolean isCaseSens); @Override List<Study> findByCriteria(String criteria); @Override boolean hasTitleBeenUsed(String oldTitle, String newTitle); @Override List<Study> listWithHasFile(List<Study> list); @Override List<Study> listWithHasFile(List<Study> list, String metaType); @Override List<Study> list(); @Override List<Study> listStudyHasFile(Registration registration, String metaType, Boolean isAsc); StudyTypeDAO getStudyTypeDAO(); void setStudyTypeDAO(StudyTypeDAO studyTypeDAO); StudyDAO getStudyDAO(); @Override Study updateDetached(Study study); @Override void updateOwners(Integer swAccession); @Override void update(Registration registration, Study study); @Override Integer insert(Registration registration, Study study); @Override Study updateDetached(Registration registration, Study study); @Override int getRunningCount(Study study); @Override int getFinishedCount(Study study); @Override int getFailedCount(Study study);  }
@Test public void testFindBySWAccession() { Study study = ss.findBySWAccession(120); assertNotNull(study); assertEquals("AbcCo_Exome_Sequencing", study.getTitle()); }