From 2342dfa0ac169e49fa227f05529707a09a88bf35 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Fri, 18 Mar 2022 00:46:00 -0400 Subject: nvdmirror: add cisa kevc url --- nvdmirror/syncconfig_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'nvdmirror/syncconfig_test.go') diff --git a/nvdmirror/syncconfig_test.go b/nvdmirror/syncconfig_test.go index cc1cdfe..5f57b2d 100644 --- a/nvdmirror/syncconfig_test.go +++ b/nvdmirror/syncconfig_test.go @@ -119,6 +119,28 @@ func TestSyncConfigGetCpeDictUrl(t *testing.T) { } } +func TestSyncConfigGetCisaKevcUrl(t *testing.T) { + tests := []struct { + name string + val string + exp string + } { + { "custom", "https://example.com/", "https://example.com/" }, + { "default", "", DefaultConfig.CisaKevcUrl }, + } + + for _, test := range(tests) { + t.Run(test.name, func(t *testing.T) { + config := SyncConfig { CisaKevcUrl: test.val } + + got := config.GetCisaKevcUrl() + if got != test.exp { + t.Errorf("got \"%s\", exp \"%s\"", got, test.exp) + } + }) + } +} + func TestSyncConfigGetMetaUrls(t *testing.T) { // declare expected result exp := make(map[string]string) -- cgit v1.2.3