@Test
public void testGeoJSONResourceFileWorks() throws MismatchedDimensionException, FactoryException, TransformException, ServiceException, IOException, JSONException {

    String endPoint = "resources://kunnat2013.json";
    RegionSet kunnatJSON = new RegionSet();
    kunnatJSON.setId(-1);
    kunnatJSON.setName("oskari:kunnat2013");
    kunnatJSON.setSrs_name("EPSG:3067");
    kunnatJSON.setAttributes(getAttributes("kuntakoodi", "kuntanimi", endPoint));
    List<Region> regions = RegionSetHelper.getRegions(kunnatJSON, "EPSG:3067");
    assertEquals(320, regions.size());
    for (Region region : regions) {
        if ("082".equals(region.getCode())) {
            assertEquals("Hattula", region.getName());
            JSONObject geoJSON = region.getGeojson();
            assertEquals(GeoJSON.FEATURE, geoJSON.getString(GeoJSON.TYPE));
            JSONObject geometry = geoJSON.getJSONObject(GeoJSON.GEOMETRY);
            assertNotNull(geometry);
            JSONObject properties = region.getGeojson().getJSONObject(GeoJSON.PROPERTIES);
            assertEquals("082", properties.get(Region.KEY_CODE));
            assertEquals("Hattula", properties.get(Region.KEY_NAME));
        } else if ("091".equals(region.getCode())) {
            assertEquals("Helsinki", region.getName());
            JSONObject geoJSON = region.getGeojson();
            assertEquals(GeoJSON.FEATURE, geoJSON.getString(GeoJSON.TYPE));
            JSONObject geometry = geoJSON.getJSONObject(GeoJSON.GEOMETRY);
            assertNotNull(geometry);
            JSONObject properties = geoJSON.getJSONObject(GeoJSON.PROPERTIES);
            assertEquals("091", properties.get(Region.KEY_CODE));
            assertEquals("Helsinki", properties.get(Region.KEY_NAME));
        }
    }
}