Skip to content

Commit 95a086c

Browse files
committed
Added test
1 parent 3fb1d95 commit 95a086c

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

internal/controller/mapserver/deployment_test.go

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,32 @@ const (
1616
)
1717

1818
func TestGetVolumeMountsForDeployment(t *testing.T) {
19-
var v2wfs v2beta1.WFS
20-
err := yaml.Unmarshal([]byte(v2WfsString), &v2wfs)
21-
assert.NoError(t, err)
22-
var wfs pdoknlv3.WFS
23-
v2beta1.V3WFSHubFromV2(&v2wfs, &wfs)
24-
19+
var wfs = getV3()
2520
pdoknlv3.SetHost("https://service.pdok.nl")
26-
result := GetVolumeMountsForDeployment(&wfs, "/srv")
21+
result := GetVolumeMountsForDeployment(wfs, "/srv")
2722

2823
var expectedVolumeMounts []v1.VolumeMount
29-
err = json.Unmarshal([]byte(expectedVolumeMountsString), &expectedVolumeMounts)
24+
err := json.Unmarshal([]byte(expectedVolumeMountsString), &expectedVolumeMounts)
3025
assert.NoError(t, err)
3126
assert.Equal(t, expectedVolumeMounts, result)
3227
}
28+
29+
func TestGetEnvVarsForDeployment(t *testing.T) {
30+
var wfs = getV3()
31+
pdoknlv3.SetHost("https://service.pdok.nl")
32+
result := GetEnvVarsForDeployment(wfs, "blobs-secret")
33+
a := 0
34+
_ = result
35+
_ = a
36+
}
37+
38+
func getV3() *pdoknlv3.WFS {
39+
var v2wfs v2beta1.WFS
40+
err := yaml.Unmarshal([]byte(v2WfsString), &v2wfs)
41+
if err != nil {
42+
panic(err)
43+
}
44+
var wfs pdoknlv3.WFS
45+
v2beta1.V3WFSHubFromV2(&v2wfs, &wfs)
46+
return &wfs
47+
}

0 commit comments

Comments
 (0)