1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-18 00:08:17 +00:00

[v0.3] Migrate the mocking library to uber's (#475)

* Migrate the mocking library to uber's (#291)

* Migrate from golang/mock to uber/mock.

* Update go.mod

* Continue migration to uber/mock.

* Tweaks from running the go.uber.mock's mockgen.

* go generate ./...

---------

Co-authored-by: Eric Promislow <epromislow@suse.com>
This commit is contained in:
Tom Lebreux
2025-02-03 15:16:36 -05:00
committed by GitHub
parent 458a12d2d7
commit d50101289f
22 changed files with 181 additions and 132 deletions

View File

@@ -1,5 +1,10 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/rancher/steve/pkg/schema (interfaces: Factory)
//
// Generated by this command:
//
// mockgen --build_flags=--mod=mod -package fake -destination fake/factory.go github.com/rancher/steve/pkg/schema Factory
//
// Package fake is a generated GoMock package.
package fake
@@ -8,9 +13,9 @@ import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
types "github.com/rancher/apiserver/pkg/types"
schema "github.com/rancher/steve/pkg/schema"
gomock "go.uber.org/mock/gomock"
schema0 "k8s.io/apimachinery/pkg/runtime/schema"
user "k8s.io/apiserver/pkg/authentication/user"
)
@@ -41,7 +46,7 @@ func (m *MockFactory) EXPECT() *MockFactoryMockRecorder {
// AddTemplate mocks base method.
func (m *MockFactory) AddTemplate(arg0 ...schema.Template) {
m.ctrl.T.Helper()
varargs := []interface{}{}
varargs := []any{}
for _, a := range arg0 {
varargs = append(varargs, a)
}
@@ -49,7 +54,7 @@ func (m *MockFactory) AddTemplate(arg0 ...schema.Template) {
}
// AddTemplate indicates an expected call of AddTemplate.
func (mr *MockFactoryMockRecorder) AddTemplate(arg0 ...interface{}) *gomock.Call {
func (mr *MockFactoryMockRecorder) AddTemplate(arg0 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddTemplate", reflect.TypeOf((*MockFactory)(nil).AddTemplate), arg0...)
}
@@ -63,7 +68,7 @@ func (m *MockFactory) ByGVK(arg0 schema0.GroupVersionKind) string {
}
// ByGVK indicates an expected call of ByGVK.
func (mr *MockFactoryMockRecorder) ByGVK(arg0 interface{}) *gomock.Call {
func (mr *MockFactoryMockRecorder) ByGVK(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ByGVK", reflect.TypeOf((*MockFactory)(nil).ByGVK), arg0)
}
@@ -77,7 +82,7 @@ func (m *MockFactory) ByGVR(arg0 schema0.GroupVersionResource) string {
}
// ByGVR indicates an expected call of ByGVR.
func (mr *MockFactoryMockRecorder) ByGVR(arg0 interface{}) *gomock.Call {
func (mr *MockFactoryMockRecorder) ByGVR(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ByGVR", reflect.TypeOf((*MockFactory)(nil).ByGVR), arg0)
}
@@ -89,7 +94,7 @@ func (m *MockFactory) OnChange(arg0 context.Context, arg1 func()) {
}
// OnChange indicates an expected call of OnChange.
func (mr *MockFactoryMockRecorder) OnChange(arg0, arg1 interface{}) *gomock.Call {
func (mr *MockFactoryMockRecorder) OnChange(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChange", reflect.TypeOf((*MockFactory)(nil).OnChange), arg0, arg1)
}
@@ -104,7 +109,7 @@ func (m *MockFactory) Schemas(arg0 user.Info) (*types.APISchemas, error) {
}
// Schemas indicates an expected call of Schemas.
func (mr *MockFactoryMockRecorder) Schemas(arg0 interface{}) *gomock.Call {
func (mr *MockFactoryMockRecorder) Schemas(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Schemas", reflect.TypeOf((*MockFactory)(nil).Schemas), arg0)
}