From f8d88080d1faf4e97ccfcb3489e963680a23e68d Mon Sep 17 00:00:00 2001 From: Alessandro Manno Date: Wed, 30 Mar 2022 09:16:56 +0200 Subject: [PATCH] fix unit test --- src/lib/http/error_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/http/error_test.go b/src/lib/http/error_test.go index f54bfecd4542..ac71f514077a 100644 --- a/src/lib/http/error_test.go +++ b/src/lib/http/error_test.go @@ -45,7 +45,7 @@ func TestSendError(t *testing.T) { err = errors.New(nil).WithCode(errors.NotFoundCode).WithMessage("object not found") SendError(rw, err) assert.Equal(t, http.StatusNotFound, rw.Code) - assert.Equal(t, `{"errors":[{"code":"NOT_FOUND","message":"object not found"}]}`+"\n", rw.Body.String()) + assert.Equal(t, `{"errors":[{"code":"MANIFEST_UNKNOWN","message":"object not found"}]}`+"\n", rw.Body.String()) } func TestAPIError(t *testing.T) { @@ -71,7 +71,7 @@ func TestAPIError(t *testing.T) { err = errors.New(nil).WithCode(errors.NotFoundCode).WithMessage("resource not found") statusCode, payload, stacktrace = apiError(err) assert.Equal(t, http.StatusNotFound, statusCode) - assert.Equal(t, `{"errors":[{"code":"NOT_FOUND","message":"resource not found"}]}`, payload) + assert.Equal(t, `{"errors":[{"code":"MANIFEST_UNKNOWN","message":"resource not found"}]}`, payload) assert.Contains(t, stacktrace, `http.TestAPIError`) // common error, common error has no stacktrace