diff --git a/model/cloudery/service_mock.go b/model/cloudery/service_mock.go index 3b7c1143613..7b692d8851f 100644 --- a/model/cloudery/service_mock.go +++ b/model/cloudery/service_mock.go @@ -40,8 +40,8 @@ func (m *Mock) LegalNoticeUrl(inst *instance.Instance) (string, error) { args := m.Called(inst) if args.Get(0) == nil { - return "", args.Error(1) + return "", args.Error(0) } - return args.Get(0).(string), args.Error(1) + return args.Get(0).(string), nil } diff --git a/model/settings/service_mock.go b/model/settings/service_mock.go index 2f31402bc7b..0b8a1a0cc56 100644 --- a/model/settings/service_mock.go +++ b/model/settings/service_mock.go @@ -80,8 +80,8 @@ func (m *Mock) GetLegalNoticeUrl(inst *instance.Instance) (string, error) { args := m.Called(inst) if args.Get(0) == nil { - return "", args.Error(1) + return "", args.Error(0) } - return args.Get(0).(string), args.Error(1) + return args.Get(0).(string), nil } diff --git a/web/settings/settings_test.go b/web/settings/settings_test.go index acb9f4e1a4c..daa573f5705 100644 --- a/web/settings/settings_test.go +++ b/web/settings/settings_test.go @@ -496,7 +496,7 @@ func TestSettings(t *testing.T) { t.Run("GetInstance", func(t *testing.T) { e := testutils.CreateTestClient(t, tsURL) - svc.On("GetLegalNoticeUrl", testInstance).Return("https://testmanager.cozycloud.cc/tos/12345.pdf").Times(3) + svc.On("GetLegalNoticeUrl", testInstance).Return("https://testmanager.cozycloud.cc/tos/12345.pdf").Once() e.GET("/settings/instance"). WithCookie(sessCookie, "connected").