Skip to content

Commit c0e715d

Browse files
committed
PDOK-18065 Atom-Operator - validation unit-tests
1 parent 8a2d141 commit c0e715d

File tree

3 files changed

+71
-1
lines changed

3 files changed

+71
-1
lines changed

api/v3/atom_validation_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestValidateAtomWithoutClusterChecks(t *testing.T) {
3737
}},
3838
},
3939
{
40-
name: "4-spatialDatasetIdentifierCode-error",
40+
name: "4-spatialDatasetIdentifierCode-missing-error",
4141
expectedWarnings: &[]string{},
4242
expectedErrors: &field.ErrorList{&field.Error{
4343
Type: "FieldValueRequired",
@@ -46,6 +46,16 @@ func TestValidateAtomWithoutClusterChecks(t *testing.T) {
4646
Detail: "when spec.service.datasetFeeds[0].datasetMetadataLinks exists",
4747
}},
4848
},
49+
{
50+
name: "5-spatialDatasetIdentifierNamespace-missing-error",
51+
expectedWarnings: &[]string{},
52+
expectedErrors: &field.ErrorList{&field.Error{
53+
Type: "FieldValueRequired",
54+
Field: "spec.service.datasetFeeds[0].spatialDatasetIdentifierNamespace",
55+
BadValue: "",
56+
Detail: "when spec.service.datasetFeeds[0].spatialDatasetIdentifierCode exists",
57+
}},
58+
},
4959
}
5060
for _, tt := range tests {
5161
actualWarnings := []string{}

api/v3/test_data/input/4-spatialDatasetIdentifierCode-error.yaml renamed to api/v3/test_data/input/4-spatialDatasetIdentifierCode-missing-error.yaml

File renamed without changes.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
apiVersion: pdok.nl/v3
2+
kind: Atom
3+
metadata:
4+
annotations:
5+
kangaroo.pdok.nl/lifecycle-phase: prod
6+
kangaroo.pdok.nl/service-bundle-ids: 65daed5f-e9e4-5791-a7c9-7e9effcca520
7+
kangaroo.pdok.nl/readonly: "true"
8+
labels:
9+
pdok.nl/dataset-id: wetlands
10+
pdok.nl/owner-id: rvo
11+
pdok.nl/service-type: atom
12+
name: asis-readonly-prod
13+
namespace: services
14+
spec:
15+
service:
16+
baseUrl: http://localhost:32788/rvo/wetlands/atom
17+
datasetFeeds:
18+
- author:
19+
email: geodatabeheer.giscc@minlnv.nl
20+
name: Ministerie van EL&I - GIS Competence Center
21+
datasetMetadataLinks:
22+
metadataIdentifier: 07d73b60-dfd6-4c54-9c82-9fac70c6c48e
23+
templates:
24+
- csw
25+
- html
26+
entries:
27+
- content:
28+
Wetlands zijn de natte natuurgebieden in Nederland (44 gebieden).
29+
Het Wetland verdrag is op 2 februari 1971 te Ramsar in Iran ondertekend.
30+
Nederland was een van de zestien landen die het Verdrag toen ondertekende.
31+
downloadlinks:
32+
- data: public/rvo/wetlands/65daed5f-e9e4-5791-a7c9-7e9effcca520/3/wetlands.gpkg
33+
polygon:
34+
bbox:
35+
maxx: "7.5553527"
36+
maxy: "55.66948"
37+
minx: "2.354173"
38+
miny: "50.71447"
39+
srs:
40+
name: Amersfoort / RD New
41+
uri: https://www.opengis.net/def/crs/EPSG/0/28992
42+
technicalName: wetlands
43+
title: wetlands
44+
updated: "2025-02-28T09:04:17Z"
45+
spatialDatasetIdentifierCode: 07d73b60-dfd6-4c54-9c82-9fac70c6c48e
46+
# spatialDatasetIdentifierNamespace: http://www.pdok.nl
47+
subtitle: wetlands
48+
technicalName: wetlands
49+
title: wetlands
50+
lang: nl
51+
ownerInfoRef: pdok
52+
rights: https://creativecommons.org/publicdomain/zero/1.0/deed.nl
53+
serviceMetadataLinks:
54+
metadataIdentifier: 2751ba40-5100-4186-81be-b7fdee95b49c
55+
templates:
56+
- csw
57+
- opensearch
58+
- html
59+
subtitle: Download Service van wetlands
60+
title: Wetlands

0 commit comments

Comments
 (0)