From 477d61b6f4bab15d49b0cc6dc563573f83242047 Mon Sep 17 00:00:00 2001 From: lilong Date: Tue, 3 May 2022 09:46:10 +0800 Subject: [PATCH] fix(unit test): add mock --- go.sum | 2 -- pkg/server/store/mock_store.go | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/go.sum b/go.sum index d5c3efd6f..b951e4689 100644 --- a/go.sum +++ b/go.sum @@ -306,8 +306,6 @@ github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.1.0-rc.5 h1:QOAag7FoBaBYYHRqzqkhhd8fq5RTubvI4v3Ft/gDVVQ= github.com/gobwas/ws v1.1.0-rc.5/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= -github.com/gocrane/api v0.2.1-0.20220311091718-54464ca2d930 h1:rJMo2ink4ECIUAVqVLcniB4BtWXTqkhnbRPgKvcDZdU= -github.com/gocrane/api v0.2.1-0.20220311091718-54464ca2d930/go.mod h1:GxI+t9AW8+NsHkz2JkPBIJN//9eLUjTZl1ScYAbXMbk= github.com/gocrane/api v0.3.0 h1:ziH+zYQy/shiqQ6yskMs67e+bQ9WmPp8eCVhLW85NFQ= github.com/gocrane/api v0.3.0/go.mod h1:GxI+t9AW8+NsHkz2JkPBIJN//9eLUjTZl1ScYAbXMbk= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= diff --git a/pkg/server/store/mock_store.go b/pkg/server/store/mock_store.go index 2531252d5..60b00ae01 100644 --- a/pkg/server/store/mock_store.go +++ b/pkg/server/store/mock_store.go @@ -142,3 +142,18 @@ func (mr *MockClusterStoreMockRecorder) UpdateCluster(arg0, arg1 interface{}) *g mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCluster", reflect.TypeOf((*MockClusterStore)(nil).UpdateCluster), arg0, arg1) } + +// ListNamespaces mocks base method. +func (m *MockClusterStore) ListNamespaces(arg0 context.Context, arg1 string) (*NamespaceList, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListNamespaces", arg0, arg1) + ret0, _ := ret[0].(*NamespaceList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListNamespaces indicates an expected call of GetCluster. +func (mr *MockClusterStoreMockRecorder) ListNamespaces(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCluster", reflect.TypeOf((*MockClusterStore)(nil).GetCluster), arg0, arg1) +}