@Test
public void transforms_a_submission_to_a_feature_list() throws IOException, XmlPullParserException {
Map<String, Feature> features = getFeatures(
Pair.of(GEOPOINT, "1 2 3"),
Pair.of(GEOTRACE, "1 2;3 4"),
Pair.of(GEOSHAPE, "1 2;3 4;5 6;1 2")
).stream().collect(toMap(
f -> f.getProperty("field"),
f -> f
));
assertThat(features.values(), hasSize(3));
assertThat(features.values(), allMatch(feature -> feature.getProperty("key").equals("uuid:39f3dd36-161e-45cb-a1a4-395831d253a7")));
assertThat(features.values(), allMatch(feature -> feature.getProperty("empty").equals("no")));
assertThat(features.get("some-field-1").getGeometry(), is(new Point(2, 1, 3)));
assertThat(features.get("some-field-2").getGeometry(), is(new LineString(new LngLatAlt(2, 1), new LngLatAlt(4, 3))));
assertThat(features.get("some-field-3").getGeometry(), is(new Polygon(new LngLatAlt(2, 1), new LngLatAlt(4, 3), new LngLatAlt(6, 5), new LngLatAlt(2, 1))));
}