diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-10-01 15:53:23 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-11-17 18:49:14 +0300 |
commit | 8fa46057342618cb4114bc590c269983f9716ced (patch) | |
tree | 00fd806b2dfeb5265f22245179dba955cfd21815 /internal | |
parent | 29c0520befcb468e8071bb7f1907626767889a65 (diff) |
test: rerun make generate-mocks
Diffstat (limited to 'internal')
-rw-r--r-- | internal/mocks/mocks.go | 76 | ||||
-rw-r--r-- | internal/mocks/source.go | 17 |
2 files changed, 46 insertions, 47 deletions
diff --git a/internal/mocks/mocks.go b/internal/mocks/mocks.go index e1f0f6d7..b18bede4 100644 --- a/internal/mocks/mocks.go +++ b/internal/mocks/mocks.go @@ -11,30 +11,30 @@ import ( gomock "github.com/golang/mock/gomock" ) -// MockArtifact is a mock of Artifact interface +// MockArtifact is a mock of Artifact interface. type MockArtifact struct { ctrl *gomock.Controller recorder *MockArtifactMockRecorder } -// MockArtifactMockRecorder is the mock recorder for MockArtifact +// MockArtifactMockRecorder is the mock recorder for MockArtifact. type MockArtifactMockRecorder struct { mock *MockArtifact } -// NewMockArtifact creates a new mock instance +// NewMockArtifact creates a new mock instance. func NewMockArtifact(ctrl *gomock.Controller) *MockArtifact { mock := &MockArtifact{ctrl: ctrl} mock.recorder = &MockArtifactMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockArtifact) EXPECT() *MockArtifactMockRecorder { return m.recorder } -// TryMakeRequest mocks base method +// TryMakeRequest mocks base method. func (m *MockArtifact) TryMakeRequest(host string, w http.ResponseWriter, r *http.Request, token string, responseHandler func(*http.Response) bool) bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TryMakeRequest", host, w, r, token, responseHandler) @@ -42,64 +42,50 @@ func (m *MockArtifact) TryMakeRequest(host string, w http.ResponseWriter, r *htt return ret0 } -// TryMakeRequest indicates an expected call of TryMakeRequest +// TryMakeRequest indicates an expected call of TryMakeRequest. func (mr *MockArtifactMockRecorder) TryMakeRequest(host, w, r, token, responseHandler interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TryMakeRequest", reflect.TypeOf((*MockArtifact)(nil).TryMakeRequest), host, w, r, token, responseHandler) } -// MockAuth is a mock of Auth interface +// MockAuth is a mock of Auth interface. type MockAuth struct { ctrl *gomock.Controller recorder *MockAuthMockRecorder } -// MockAuthMockRecorder is the mock recorder for MockAuth +// MockAuthMockRecorder is the mock recorder for MockAuth. type MockAuthMockRecorder struct { mock *MockAuth } -// NewMockAuth creates a new mock instance +// NewMockAuth creates a new mock instance. func NewMockAuth(ctrl *gomock.Controller) *MockAuth { mock := &MockAuth{ctrl: ctrl} mock.recorder = &MockAuthMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAuth) EXPECT() *MockAuthMockRecorder { return m.recorder } -// IsAuthSupported mocks base method -func (m *MockAuth) IsAuthSupported() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsAuthSupported") - ret0, _ := ret[0].(bool) - return ret0 -} - -// IsAuthSupported indicates an expected call of IsAuthSupported -func (mr *MockAuthMockRecorder) IsAuthSupported() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAuthSupported", reflect.TypeOf((*MockAuth)(nil).IsAuthSupported)) -} - -// RequireAuth mocks base method -func (m *MockAuth) RequireAuth(w http.ResponseWriter, r *http.Request) bool { +// CheckResponseForInvalidToken mocks base method. +func (m *MockAuth) CheckResponseForInvalidToken(w http.ResponseWriter, r *http.Request, resp *http.Response) bool { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RequireAuth", w, r) + ret := m.ctrl.Call(m, "CheckResponseForInvalidToken", w, r, resp) ret0, _ := ret[0].(bool) return ret0 } -// RequireAuth indicates an expected call of RequireAuth -func (mr *MockAuthMockRecorder) RequireAuth(w, r interface{}) *gomock.Call { +// CheckResponseForInvalidToken indicates an expected call of CheckResponseForInvalidToken. +func (mr *MockAuthMockRecorder) CheckResponseForInvalidToken(w, r, resp interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequireAuth", reflect.TypeOf((*MockAuth)(nil).RequireAuth), w, r) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckResponseForInvalidToken", reflect.TypeOf((*MockAuth)(nil).CheckResponseForInvalidToken), w, r, resp) } -// GetTokenIfExists mocks base method +// GetTokenIfExists mocks base method. func (m *MockAuth) GetTokenIfExists(w http.ResponseWriter, r *http.Request) (string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetTokenIfExists", w, r) @@ -108,22 +94,36 @@ func (m *MockAuth) GetTokenIfExists(w http.ResponseWriter, r *http.Request) (str return ret0, ret1 } -// GetTokenIfExists indicates an expected call of GetTokenIfExists +// GetTokenIfExists indicates an expected call of GetTokenIfExists. func (mr *MockAuthMockRecorder) GetTokenIfExists(w, r interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenIfExists", reflect.TypeOf((*MockAuth)(nil).GetTokenIfExists), w, r) } -// CheckResponseForInvalidToken mocks base method -func (m *MockAuth) CheckResponseForInvalidToken(w http.ResponseWriter, r *http.Request, resp *http.Response) bool { +// IsAuthSupported mocks base method. +func (m *MockAuth) IsAuthSupported() bool { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CheckResponseForInvalidToken", w, r, resp) + ret := m.ctrl.Call(m, "IsAuthSupported") ret0, _ := ret[0].(bool) return ret0 } -// CheckResponseForInvalidToken indicates an expected call of CheckResponseForInvalidToken -func (mr *MockAuthMockRecorder) CheckResponseForInvalidToken(w, r, resp interface{}) *gomock.Call { +// IsAuthSupported indicates an expected call of IsAuthSupported. +func (mr *MockAuthMockRecorder) IsAuthSupported() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckResponseForInvalidToken", reflect.TypeOf((*MockAuth)(nil).CheckResponseForInvalidToken), w, r, resp) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAuthSupported", reflect.TypeOf((*MockAuth)(nil).IsAuthSupported)) +} + +// RequireAuth mocks base method. +func (m *MockAuth) RequireAuth(w http.ResponseWriter, r *http.Request) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RequireAuth", w, r) + ret0, _ := ret[0].(bool) + return ret0 +} + +// RequireAuth indicates an expected call of RequireAuth. +func (mr *MockAuthMockRecorder) RequireAuth(w, r interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequireAuth", reflect.TypeOf((*MockAuth)(nil).RequireAuth), w, r) } diff --git a/internal/mocks/source.go b/internal/mocks/source.go index fe8c3198..5412310f 100644 --- a/internal/mocks/source.go +++ b/internal/mocks/source.go @@ -9,44 +9,43 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - domain "gitlab.com/gitlab-org/gitlab-pages/internal/domain" ) -// MockSource is a mock of Source interface +// MockSource is a mock of Source interface. type MockSource struct { ctrl *gomock.Controller recorder *MockSourceMockRecorder } -// MockSourceMockRecorder is the mock recorder for MockSource +// MockSourceMockRecorder is the mock recorder for MockSource. type MockSourceMockRecorder struct { mock *MockSource } -// NewMockSource creates a new mock instance +// NewMockSource creates a new mock instance. func NewMockSource(ctrl *gomock.Controller) *MockSource { mock := &MockSource{ctrl: ctrl} mock.recorder = &MockSourceMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockSource) EXPECT() *MockSourceMockRecorder { return m.recorder } -// GetDomain mocks base method +// GetDomain mocks base method. func (m *MockSource) GetDomain(arg0 context.Context, arg1 string) (*domain.Domain, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FromRequest", arg0, arg1) + ret := m.ctrl.Call(m, "GetDomain", arg0, arg1) ret0, _ := ret[0].(*domain.Domain) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetDomain indicates an expected call of GetDomain +// GetDomain indicates an expected call of GetDomain. func (mr *MockSourceMockRecorder) GetDomain(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FromRequest", reflect.TypeOf((*MockSource)(nil).GetDomain), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDomain", reflect.TypeOf((*MockSource)(nil).GetDomain), arg0, arg1) } |