Skip to content

Commit

Permalink
fix(sscs-env-var): fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
cx-ruio committed Feb 6, 2025
1 parent f3fb8d1 commit 2375f6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/commands/util/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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])
}
}
Expand Down
7 changes: 3 additions & 4 deletions internal/wrappers/scan-overview-http.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type ScanOverviewHTTPWrapper struct {
}

func NewHTTPScanOverviewWrapper(path string) ScanOverviewWrapper {
validPath := configurePath(path)
validPath := setDefaultPath(path)
return &ScanOverviewHTTPWrapper{
path: validPath,
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2375f6f

Please sign in to comment.