@Ignore("Depends on outside service, results might vary")
@Test
public void testGetFeaturesServiceSupportingCRS_EPSG3067() throws Exception {

    OskariLayer layer = new OskariLayer();
    layer.setUrl("https://beta-paikkatieto.maanmittauslaitos.fi/maastotiedot/wfs3/v1/");
    layer.setName("rakennus");
    layer.setCapabilities(JSONHelper.createJSONObject("crs-uri", new JSONArray(Arrays.asList("http://www.opengis.net/def/crs/EPSG/0/3067"))));
    CoordinateReferenceSystem epsg3067 = CRS.decode("EPSG:3067");
    ReferencedEnvelope bbox = new ReferencedEnvelope(500000, 501000, 6822000, 6823000, epsg3067);
    SimpleFeatureCollection sfc = OskariWFS3Client.getFeatures(layer, bbox, epsg3067);
    assertFalse(sfc.isEmpty());
    try (SimpleFeatureIterator it = sfc.features()) {
        while (it.hasNext()) {
            Geometry geometryEnvelope = ((Geometry) it.next().getDefaultGeometry()).getEnvelope();
            assertTrue(geometryEnvelope.within(JTS.toGeometry(bbox)));
        }
    }
}