ExperimentServiceImpl implements ExperimentService { @Override public Experiment findByTitle(String title) { Experiment experiment = null; if (title != null) { try { experiment = experimentDAO.findByTitle(title.trim()); } catch (Exception exception) { LOG.debug("Cannot find Experiment by title " + title); } } return experiment; } ExperimentServiceImpl(); @Override void setExperimentDAO(ExperimentDAO experimentDAO); void setFileDAO(FileDAO fileDAO); @Override Integer insert(Experiment experiment); @Override void update(Experiment experiment); @Override void merge(Experiment experiment); @Override void delete(Experiment experiment, boolean deleteRealFiles); @Override List<Experiment> list(Registration registration); @Override List<Experiment> list(Study study); @Override List<File> getFiles(Integer experimentId); @Override boolean isHasFile(Integer experimentId); @Override List<File> getFiles(Integer studyId, String metaType); @Override boolean isHasFile(Integer studyId, String metaType); @Override SortedSet<Experiment> setWithHasFile(SortedSet<Experiment> list); @Override SortedSet<Experiment> listWithHasFile(SortedSet<Experiment> list, String metaType); @Override Experiment findByTitle(String title); @Override Experiment findByID(Integer expID); @Override Experiment findBySWAccession(Integer swAccession); @Override boolean hasTitleBeenUsed(String oldTitle, String newTitle); @Override Experiment updateDetached(Experiment experiment); @Override List<Experiment> findByOwnerID(Integer registrationID); @Override List<Experiment> findByCriteria(String criteria, boolean isCaseSens); @Override List<Experiment> list(); @Override void update(Registration registration, Experiment experiment); @Override Integer insert(Registration registration, Experiment experiment); @Override Experiment updateDetached(Registration registration, Experiment experiment);  }
@Test public void testFindByTitle() { ExperimentService experimentService = BeanFactory.getExperimentServiceBean(); Experiment experiment = experimentService.findByTitle("MixExp1"); assertNotNull(experiment); Experiment experimentCaseInsensitive = experimentService.findByTitle("mixexp1"); assertNotNull(experimentCaseInsensitive); assertEquals(experiment.getTitle(), experimentCaseInsensitive.getTitle()); }