Refactor integration test DecodeJSON calls to use generic return value (#37432)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -23,8 +23,7 @@ func TestAPIListLicenseTemplates(t *testing.T) {
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
// This tests if the API returns a list of strings
|
||||
var licenseList []api.LicensesTemplateListEntry
|
||||
DecodeJSON(t, resp, &licenseList)
|
||||
DecodeJSON(t, resp, []api.LicensesTemplateListEntry{})
|
||||
}
|
||||
|
||||
func TestAPIGetLicenseTemplateInfo(t *testing.T) {
|
||||
@@ -42,8 +41,7 @@ func TestAPIGetLicenseTemplateInfo(t *testing.T) {
|
||||
req := NewRequest(t, "GET", urlStr)
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var licenseInfo api.LicenseTemplateInfo
|
||||
DecodeJSON(t, resp, &licenseInfo)
|
||||
licenseInfo := DecodeJSON(t, resp, &api.LicenseTemplateInfo{})
|
||||
|
||||
// We get the text of the template here
|
||||
text, _ := options.License(licenseName)
|
||||
|
||||
Reference in New Issue
Block a user