summaryrefslogtreecommitdiffstats
path: root/tests/integration/api_packages_goproxy_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/api_packages_goproxy_test.go')
-rw-r--r--tests/integration/api_packages_goproxy_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/integration/api_packages_goproxy_test.go b/tests/integration/api_packages_goproxy_test.go
index 08c1ca54f1..dab9fefc5e 100644
--- a/tests/integration/api_packages_goproxy_test.go
+++ b/tests/integration/api_packages_goproxy_test.go
@@ -51,16 +51,16 @@ func TestPackageGo(t *testing.T) {
req := NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content))
MakeRequest(t, req, http.StatusUnauthorized)
- req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content))
- AddBasicAuthHeader(req, user.Name)
+ req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content)).
+ AddBasicAuth(user.Name)
MakeRequest(t, req, http.StatusBadRequest)
content = createArchive(map[string][]byte{
packageName + "@" + packageVersion + "/go.mod": []byte(goModContent),
})
- req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content))
- AddBasicAuthHeader(req, user.Name)
+ req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content)).
+ AddBasicAuth(user.Name)
MakeRequest(t, req, http.StatusCreated)
pvs, err := packages.GetVersionsByPackageType(db.DefaultContext, user.ID, packages.TypeGo)
@@ -83,8 +83,8 @@ func TestPackageGo(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, int64(len(content)), pb.Size)
- req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content))
- AddBasicAuthHeader(req, user.Name)
+ req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content)).
+ AddBasicAuth(user.Name)
MakeRequest(t, req, http.StatusConflict)
time.Sleep(time.Second)
@@ -93,8 +93,8 @@ func TestPackageGo(t *testing.T) {
packageName + "@" + packageVersion2 + "/go.mod": []byte(goModContent),
})
- req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content))
- AddBasicAuthHeader(req, user.Name)
+ req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content)).
+ AddBasicAuth(user.Name)
MakeRequest(t, req, http.StatusCreated)
})