diff --git a/internal/commands/util/configuration_test.go b/internal/commands/util/configuration_test.go index a6b8e3d99..1b980de53 100644 --- a/internal/commands/util/configuration_test.go +++ b/internal/commands/util/configuration_test.go @@ -130,7 +130,7 @@ func TestWriteSingleConfigKeyStringNonExistingFile_CreatingTheFileAndWritesTheKe asserts.NotNil(t, file) } -func TestChangedOnlyScsScanOverviewPathInConfigFile_ConfigFileExistsWithDefaultValues_OnlyAscaPortChangedSuccess(t *testing.T) { +func TestChangedOnlyScsScanOverviewPathInConfigFile_ConfigFileExistsWithDefaultValues_OnlyScsScanOverviewPathChangedSuccess(t *testing.T) { configuration.LoadConfiguration() configFilePath, _ := configuration.GetConfigFilePath() @@ -146,7 +146,7 @@ func TestChangedOnlyScsScanOverviewPathInConfigFile_ConfigFileExistsWithDefaultV // Assert all the other properties are the same for key, value := range oldConfig { - if key != cxAscaPort { + if key != cxScsScanOverviewPath { asserts.Equal(t, value, config[key]) } } diff --git a/internal/wrappers/scan-overview-http.go b/internal/wrappers/scan-overview-http.go index 668ea4310..28246ec10 100644 --- a/internal/wrappers/scan-overview-http.go +++ b/internal/wrappers/scan-overview-http.go @@ -19,7 +19,7 @@ type ScanOverviewHTTPWrapper struct { } func NewHTTPScanOverviewWrapper(path string) ScanOverviewWrapper { - validPath := configurePath(path) + validPath := setDefaultPath(path) return &ScanOverviewHTTPWrapper{ path: validPath, } @@ -64,10 +64,9 @@ func (r *ScanOverviewHTTPWrapper) GetSCSOverviewByScanID(scanID string) ( } } -// configurePath checks if the path is the default path, if not it writes the default path to the config file -func configurePath(path string) string { +// setDefaultPath checks if the path is the default path, if not it writes the default path to the config file +func setDefaultPath(path string) string { if path != defaultPath { - viper.Set(commonParams.ScsScanOverviewPathKey, defaultPath) configFilePath, err := configuration.GetConfigFilePath() if err != nil { logger.PrintfIfVerbose("Error getting config file path: %v", err)