MapLayerDao { public List<MapLayer> findWMSMapLayers() { try (SqlSession session = factory.openSession()) { return session.getMapper(MAPPER).selectWMSLayers(); } } MapLayerDao();  MapLayerDao(final DataSource ds); List<MapLayer> findWMSMapLayers(); List<MapLayer> findWFSMapLayers();  }
@Test @Ignore("Requires a database connection, assumes DB state") public void sanityTest() { PGSimpleDataSource ds = new PGSimpleDataSource(); ds.setUrl(System.getProperty("oskari.test.db.url")); MapLayerDao dao = new MapLayerDao(ds); List<MapLayer> wmsLayers = dao.findWMSMapLayers(); assertNotNull(wmsLayers); assertTrue("Finds atleast one WMS Layer", wmsLayers.size() > 0); List<MapLayer> wfsLayers = dao.findWMSMapLayers(); assertNotNull(wfsLayers); assertTrue("Finds atleast one WFS Layer", wfsLayers.size() > 0); }