mirror of https://github.com/goharbor/harbor.git
201 lines
4.8 KiB
Go
201 lines
4.8 KiB
Go
// Code generated by mockery v2.22.1. DO NOT EDIT.
|
|
|
|
package usergroup
|
|
|
|
import (
|
|
context "context"
|
|
|
|
model "github.com/goharbor/harbor/src/pkg/usergroup/model"
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
q "github.com/goharbor/harbor/src/lib/q"
|
|
)
|
|
|
|
// Manager is an autogenerated mock type for the Manager type
|
|
type Manager struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Count provides a mock function with given fields: ctx, query
|
|
func (_m *Manager) Count(ctx context.Context, query *q.Query) (int64, error) {
|
|
ret := _m.Called(ctx, query)
|
|
|
|
var r0 int64
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *q.Query) (int64, error)); ok {
|
|
return rf(ctx, query)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *q.Query) int64); ok {
|
|
r0 = rf(ctx, query)
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *q.Query) error); ok {
|
|
r1 = rf(ctx, query)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Create provides a mock function with given fields: ctx, userGroup
|
|
func (_m *Manager) Create(ctx context.Context, userGroup model.UserGroup) (int, error) {
|
|
ret := _m.Called(ctx, userGroup)
|
|
|
|
var r0 int
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, model.UserGroup) (int, error)); ok {
|
|
return rf(ctx, userGroup)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, model.UserGroup) int); ok {
|
|
r0 = rf(ctx, userGroup)
|
|
} else {
|
|
r0 = ret.Get(0).(int)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, model.UserGroup) error); ok {
|
|
r1 = rf(ctx, userGroup)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Delete provides a mock function with given fields: ctx, id
|
|
func (_m *Manager) Delete(ctx context.Context, id int) error {
|
|
ret := _m.Called(ctx, id)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int) error); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Get provides a mock function with given fields: ctx, id
|
|
func (_m *Manager) Get(ctx context.Context, id int) (*model.UserGroup, error) {
|
|
ret := _m.Called(ctx, id)
|
|
|
|
var r0 *model.UserGroup
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int) (*model.UserGroup, error)); ok {
|
|
return rf(ctx, id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, int) *model.UserGroup); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.UserGroup)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
|
|
r1 = rf(ctx, id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// List provides a mock function with given fields: ctx, query
|
|
func (_m *Manager) List(ctx context.Context, query *q.Query) ([]*model.UserGroup, error) {
|
|
ret := _m.Called(ctx, query)
|
|
|
|
var r0 []*model.UserGroup
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *q.Query) ([]*model.UserGroup, error)); ok {
|
|
return rf(ctx, query)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *q.Query) []*model.UserGroup); ok {
|
|
r0 = rf(ctx, query)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.UserGroup)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *q.Query) error); ok {
|
|
r1 = rf(ctx, query)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Onboard provides a mock function with given fields: ctx, g
|
|
func (_m *Manager) Onboard(ctx context.Context, g *model.UserGroup) error {
|
|
ret := _m.Called(ctx, g)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *model.UserGroup) error); ok {
|
|
r0 = rf(ctx, g)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Populate provides a mock function with given fields: ctx, userGroups
|
|
func (_m *Manager) Populate(ctx context.Context, userGroups []model.UserGroup) ([]int, error) {
|
|
ret := _m.Called(ctx, userGroups)
|
|
|
|
var r0 []int
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, []model.UserGroup) ([]int, error)); ok {
|
|
return rf(ctx, userGroups)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, []model.UserGroup) []int); ok {
|
|
r0 = rf(ctx, userGroups)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]int)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, []model.UserGroup) error); ok {
|
|
r1 = rf(ctx, userGroups)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UpdateName provides a mock function with given fields: ctx, id, groupName
|
|
func (_m *Manager) UpdateName(ctx context.Context, id int, groupName string) error {
|
|
ret := _m.Called(ctx, id, groupName)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int, string) error); ok {
|
|
r0 = rf(ctx, id, groupName)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
type mockConstructorTestingTNewManager interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewManager creates a new instance of Manager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewManager(t mockConstructorTestingTNewManager) *Manager {
|
|
mock := &Manager{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|