RegulatoryFeatureDao { public List<RegulatoryFeature> getRegulatoryFeatures() { try ( Connection connection = dataSource.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement("select CHROMOSOME as chr, START as start, \"end\" as end, FEATURE_TYPE as feature_type from REGULATORY_REGIONS"); ResultSet rs = preparedStatement.executeQuery()) { return processRegulatoryFeatureResults(rs); } catch (SQLException e) { logger.error("Error executing regulatory feature query: ", e); } return Collections.emptyList(); } RegulatoryFeatureDao(DataSource genomeDataSource); List<RegulatoryFeature> getRegulatoryFeatures();  }
@Test public void testGetAllRegulatoryFeatures() { List<RegulatoryFeature> regulatoryFeatures = new ArrayList<>(); regulatoryFeatures.add(new RegulatoryFeature(11, 96762600, 96763399, RegulatoryFeature.FeatureType.ENHANCER)); regulatoryFeatures.add(new RegulatoryFeature(11, 96798354, 96798827, RegulatoryFeature.FeatureType.FANTOM_PERMISSIVE)); List<RegulatoryFeature> results = instance.getRegulatoryFeatures(); assertThat(results.size(), equalTo(2)); for (RegulatoryFeature result : results) { assertThat(regulatoryFeatures, hasItem(result)); assertThat(result.getFeatureType(), not(RegulatoryFeature.FeatureType.UNKNOWN)); } }