Skip to content

Commit

Permalink
Add CreateXscRestsMockServer.
Browse files Browse the repository at this point in the history
  • Loading branch information
gailazar300 committed Mar 31, 2024
1 parent dc94539 commit bea3dd6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions common/tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ func CreateDsRestsMockServer(t *testing.T, testHandler restsTestHandler) (*httpt
return testServer, serverDetails, serviceManager
}

func CreateXscRestsMockServer(t *testing.T, testHandler restsTestHandler) (*httptest.Server, *config.ServerDetails, artifactory.ArtifactoryServicesManager) {
testServer := CreateRestsMockServer(testHandler)
serverDetails := &config.ServerDetails{Url: testServer.URL + "/", XrayUrl: testServer.URL + "/xray/"}

serviceManager, err := utils.CreateServiceManager(serverDetails, -1, 0, false)
assert.NoError(t, err)
return testServer, serverDetails, serviceManager
}

// Set progressbar.ShouldInitProgressBar func to always return true
// so the progress bar library will be initialized and progress will be displayed.
// The returned callback sets the original func back.
Expand Down

0 comments on commit bea3dd6

Please sign in to comment.