diff --git a/src/ui/api/harborapi_test.go b/src/ui/api/harborapi_test.go index fa5f85feda..426a45e359 100644 --- a/src/ui/api/harborapi_test.go +++ b/src/ui/api/harborapi_test.go @@ -342,12 +342,13 @@ func (a testapi) ProjectsGet(query *apilib.ProjectQuery, authInfo ...usrInfo) (i if len(authInfo) > 0 { httpStatusCode, body, err = request(_sling, jsonAcceptHeader, authInfo[0]) } else { - log.Println("enter no auth $$$$$$$$$$$$$$$$$$$") httpStatusCode, body, err = request(_sling, jsonAcceptHeader) } if err == nil && httpStatusCode == 200 { err = json.Unmarshal(body, &successPayload) + } else { + log.Println(string(body)) } return httpStatusCode, successPayload, err diff --git a/src/ui/api/log_test.go b/src/ui/api/log_test.go index f9c83d962b..cfef525797 100644 --- a/src/ui/api/log_test.go +++ b/src/ui/api/log_test.go @@ -82,7 +82,6 @@ func TestLogGet(t *testing.T) { assert.Equal(int(200), httpStatusCode, "httpStatusCode should be 200") addProjectID = projects[0].ProjectId } - t.Logf("%%%%%%%%%%%%% %v", projects) //delete the project projectID := strconv.Itoa(int(addProjectID)) diff --git a/tests/apitests/apilib/access_log_filter.go b/tests/apitests/apilib/access_log_filter.go index 0b6b63d685..9a3a38ad74 100644 --- a/tests/apitests/apilib/access_log_filter.go +++ b/tests/apitests/apilib/access_log_filter.go @@ -23,12 +23,12 @@ package apilib type LogQuery struct { - Username string `json:"username"` - Repository string `json:"repository"` - Tag string `json:"tag"` - Operation []string `json:"operation"` - BeginTimestamp int64 `json:"begin_timestamp"` - EndTimestamp int64 `json:"end_timestamp"` - Page int64 `json:"page"` - PageSize int64 `json:"page_size"` + Username string `url:"username,omitempty"` + Repository string `url:"repository,omitempty"` + Tag string `url:"tag,omitempty"` + Operation []string `url:"operation,omitempty"` + BeginTimestamp int64 `url:"begin_timestamp,omitempty"` + EndTimestamp int64 `url:"end_timestamp,omitempty"` + Page int64 `url:"page,omitempty"` + PageSize int64 `url:"page_size,omitempty"` } diff --git a/tests/apitests/apilib/project.go b/tests/apitests/apilib/project.go index abf1c7480f..7aae3714d8 100644 --- a/tests/apitests/apilib/project.go +++ b/tests/apitests/apilib/project.go @@ -59,11 +59,11 @@ type Project struct { } type ProjectQuery struct { - Name string `json:"name"` - Owner string `json:"owner"` - Public bool `json:"public"` - Member string `json:"member"` - Role int `json:"role"` - Page int64 `json:"page"` - PageSize int64 `json:"page_size"` + Name string `url:"name,omitempty"` + Owner string `url:"owner,omitempty"` + Public bool `url:"public,omitempty"` + Member string `url:"member,omitempty"` + Role int `url:"role,omitempty"` + Page int64 `url:"page,omitempty"` + PageSize int64 `url:"page_size,omitempty"` }