Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.build.mk1
-rw-r--r--internal/mocks/api/client_stub.go8
-rw-r--r--internal/mocks/client.go64
3 files changed, 73 insertions, 0 deletions
diff --git a/Makefile.build.mk b/Makefile.build.mk
index 3202b0de..cdd2f295 100644
--- a/Makefile.build.mk
+++ b/Makefile.build.mk
@@ -17,6 +17,7 @@ cisetup: .GOPATH/.ok
generate-mocks: .GOPATH/.ok
$Q bin/mockgen -source=internal/interface.go -destination=internal/mocks/mocks.go -package=mocks
$Q bin/mockgen -source=internal/source/source.go -destination=internal/mocks/source.go -package=mocks
+ $Q bin/mockgen -source=internal/mocks/client_stub.go -destination=internal/mocks/client.go -package=mocks
build: .GOPATH/.ok
$Q GOBIN=$(CURDIR)/bin go install $(if $V,-v) $(VERSION_FLAGS) -tags "${GO_BUILD_TAGS}" -buildmode exe $(IMPORT_PATH)
diff --git a/internal/mocks/api/client_stub.go b/internal/mocks/api/client_stub.go
new file mode 100644
index 00000000..f1a20754
--- /dev/null
+++ b/internal/mocks/api/client_stub.go
@@ -0,0 +1,8 @@
+package mocks
+
+import "gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab/api"
+
+type ClientStub interface {
+ api.Client
+ api.Resolver
+}
diff --git a/internal/mocks/client.go b/internal/mocks/client.go
new file mode 100644
index 00000000..024aeba0
--- /dev/null
+++ b/internal/mocks/client.go
@@ -0,0 +1,64 @@
+// Code generated by MockGen. DO NOT EDIT.
+// Source: internal/mocks/client_stub.go
+
+// Package mocks is a generated GoMock package.
+package mocks
+
+import (
+ context "context"
+ reflect "reflect"
+
+ gomock "github.com/golang/mock/gomock"
+ api "gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab/api"
+)
+
+// MockClientStub is a mock of ClientStub interface.
+type MockClientStub struct {
+ ctrl *gomock.Controller
+ recorder *MockClientStubMockRecorder
+}
+
+// MockClientStubMockRecorder is the mock recorder for MockClientStub.
+type MockClientStubMockRecorder struct {
+ mock *MockClientStub
+}
+
+// NewMockClientStub creates a new mock instance.
+func NewMockClientStub(ctrl *gomock.Controller) *MockClientStub {
+ mock := &MockClientStub{ctrl: ctrl}
+ mock.recorder = &MockClientStubMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use.
+func (m *MockClientStub) EXPECT() *MockClientStubMockRecorder {
+ return m.recorder
+}
+
+// GetLookup mocks base method.
+func (m *MockClientStub) GetLookup(ctx context.Context, domain string) api.Lookup {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetLookup", ctx, domain)
+ ret0, _ := ret[0].(api.Lookup)
+ return ret0
+}
+
+// GetLookup indicates an expected call of GetLookup.
+func (mr *MockClientStubMockRecorder) GetLookup(ctx, domain interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLookup", reflect.TypeOf((*MockClientStub)(nil).GetLookup), ctx, domain)
+}
+
+// Resolve mocks base method.
+func (m *MockClientStub) Resolve(ctx context.Context, domain string) *api.Lookup {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Resolve", ctx, domain)
+ ret0, _ := ret[0].(*api.Lookup)
+ return ret0
+}
+
+// Resolve indicates an expected call of Resolve.
+func (mr *MockClientStubMockRecorder) Resolve(ctx, domain interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Resolve", reflect.TypeOf((*MockClientStub)(nil).Resolve), ctx, domain)
+}