DefaultDiseaseDao implements DiseaseDao { @Cacheable(value = "diseaseHp") @Override public Set<String> getHpoIdsForDiseaseId(String diseaseId) { try (Connection connection = dataSource.getConnection()) { try (PreparedStatement statement = connection.prepareStatement("SELECT hp_id FROM disease_hp WHERE disease_id = ?")) { statement.setString(1, diseaseId); ResultSet rs = statement.executeQuery(); Set<String> diseaseHpoIds = parseHpoIds(rs); logger.info("{} HPO ids retrieved for disease {} - {}", diseaseHpoIds.size(), diseaseId, diseaseHpoIds); return diseaseHpoIds; } } catch (SQLException e) { logger.error("Unable to retrieve HPO terms for disease {}", diseaseId, e); } return Collections.emptySet(); } DefaultDiseaseDao(DataSource phenotypeDataSource); @Cacheable(value = "diseaseHp") @Override Set<String> getHpoIdsForDiseaseId(String diseaseId); @Cacheable(value = "diseases") @Override List<Disease> getDiseaseDataAssociatedWithGeneId(int geneId);  }
@Test public void testGetHpoIdsForDiseaseId() { Set<String> omim101600HpoIds = Sets.newTreeSet(disease.getPhenotypeIds()); assertThat(instance.getHpoIdsForDiseaseId("OMIM:101600"), equalTo(omim101600HpoIds)); }