Skip to content

Commit

Permalink
chore: add extra testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
rkettelerij committed Dec 30, 2024
1 parent c5a260d commit 1c98539
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 14 deletions.
28 changes: 14 additions & 14 deletions internal/ogc/features/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,20 +1051,20 @@ func TestFeatures_Feature(t *testing.T) {
statusCode: http.StatusOK,
},
},
// {
// name: "Request JSON-FG for feature with null geom",
// fields: fields{
// configFile: "internal/ogc/features/testdata/config_features_geom_empty_point.yaml",
// url: "http://localhost:8080/collections/:collectionId/items/:featureId?f=jsonfg",
// collectionID: "foo",
// featureID: "129",
// format: "json",
// },
// want: want{
// body: "internal/ogc/features/testdata/expected_feature_geom_empty_point_jsonfg.json",
// statusCode: http.StatusOK,
// },
// },
{
name: "Request JSON-FG for feature with empty point",
fields: fields{
configFile: "internal/ogc/features/testdata/config_features_geom_null_empty.yaml",
url: "http://localhost:8080/collections/:collectionId/items/:featureId?f=jsonfg",
collectionID: "foo",
featureID: "3542",
format: "json",
},
want: want{
body: "internal/ogc/features/testdata/expected_feature_geom_empty_point_jsonfg.json",
statusCode: http.StatusOK,
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"id": "3542",
"type": "Feature",
"time": null,
"place": null,
"geometry": null,
"properties": {
"datum_doc": "1900-01-01",
"datum_eind": null,
"datum_strt": "1900-01-01",
"document": "GV00000402",
"huisletter": null,
"huisnummer": 14,
"nummer_id": "0363200000454013",
"postcode": "1013CR",
"rdf_seealso": "http://bag.basisregistraties.overheid.nl/bag/id/nummeraanduiding/0363200000454013",
"status": "Naamgeving uitgegeven",
"straatnaam": "Van Diemenkade",
"toevoeging": null,
"type": "Ligplaats",
"woonplaats": "Amsterdam"
},
"coordRefSys": "http://www.opengis.net/def/crs/OGC/1.3/CRS84",
"links": [
{
"rel": "self",
"title": "This document as JSON-FG",
"type": "application/vnd.ogc.fg+json",
"href": "http://localhost:8080/collections/foo/items/3542?f=jsonfg"
},
{
"rel": "alternate",
"title": "This document as GeoJSON",
"type": "application/geo+json",
"href": "http://localhost:8080/collections/foo/items/3542?f=json"
},
{
"rel": "alternate",
"title": "This document as HTML",
"type": "text/html",
"href": "http://localhost:8080/collections/foo/items/3542?f=html"
},
{
"rel": "collection",
"title": "The collection to which this feature belongs",
"type": "application/json",
"href": "http://localhost:8080/collections/foo?f=json"
}
],
"conformsTo": [
"http://www.opengis.net/spec/json-fg-1/0.2/conf/core"
]
}

0 comments on commit 1c98539

Please sign in to comment.