@@ -28,6 +28,7 @@ import (
28
28
"code.gitea.io/gitea/modules/base"
29
29
"code.gitea.io/gitea/modules/git"
30
30
"code.gitea.io/gitea/modules/graceful"
31
+ "code.gitea.io/gitea/modules/json"
31
32
"code.gitea.io/gitea/modules/log"
32
33
"code.gitea.io/gitea/modules/queue"
33
34
"code.gitea.io/gitea/modules/setting"
@@ -37,7 +38,6 @@ import (
37
38
"code.gitea.io/gitea/routers"
38
39
39
40
"github.com/PuerkitoBio/goquery"
40
- jsoniter "github.com/json-iterator/go"
41
41
"github.com/stretchr/testify/assert"
42
42
)
43
43
@@ -416,7 +416,6 @@ func NewRequestWithValues(t testing.TB, method, urlStr string, values map[string
416
416
func NewRequestWithJSON (t testing.TB , method , urlStr string , v interface {}) * http.Request {
417
417
t .Helper ()
418
418
419
- json := jsoniter .ConfigCompatibleWithStandardLibrary
420
419
jsonBytes , err := json .Marshal (v )
421
420
assert .NoError (t , err )
422
421
req := NewRequestWithBody (t , method , urlStr , bytes .NewBuffer (jsonBytes ))
@@ -508,7 +507,6 @@ func logUnexpectedResponse(t testing.TB, recorder *httptest.ResponseRecorder) {
508
507
func DecodeJSON (t testing.TB , resp * httptest.ResponseRecorder , v interface {}) {
509
508
t .Helper ()
510
509
511
- json := jsoniter .ConfigCompatibleWithStandardLibrary
512
510
decoder := json .NewDecoder (resp .Body )
513
511
assert .NoError (t , decoder .Decode (v ))
514
512
}
0 commit comments