mirror of https://github.com/goharbor/harbor.git
275 lines
6.7 KiB
Go
275 lines
6.7 KiB
Go
// Code generated by mockery v2.14.0. DO NOT EDIT.
|
|
|
|
package user
|
|
|
|
import (
|
|
context "context"
|
|
|
|
commonmodels "github.com/goharbor/harbor/src/common/models"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
models "github.com/goharbor/harbor/src/pkg/user/models"
|
|
|
|
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, options
|
|
func (_m *Manager) Count(ctx context.Context, query *q.Query, options ...models.Option) (int64, error) {
|
|
_va := make([]interface{}, len(options))
|
|
for _i := range options {
|
|
_va[_i] = options[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, ctx, query)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
var r0 int64
|
|
if rf, ok := ret.Get(0).(func(context.Context, *q.Query, ...models.Option) int64); ok {
|
|
r0 = rf(ctx, query, options...)
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, *q.Query, ...models.Option) error); ok {
|
|
r1 = rf(ctx, query, options...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Create provides a mock function with given fields: ctx, _a1
|
|
func (_m *Manager) Create(ctx context.Context, _a1 *commonmodels.User) (int, error) {
|
|
ret := _m.Called(ctx, _a1)
|
|
|
|
var r0 int
|
|
if rf, ok := ret.Get(0).(func(context.Context, *commonmodels.User) int); ok {
|
|
r0 = rf(ctx, _a1)
|
|
} else {
|
|
r0 = ret.Get(0).(int)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, *commonmodels.User) error); ok {
|
|
r1 = rf(ctx, _a1)
|
|
} 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
|
|
}
|
|
|
|
// DeleteGDPR provides a mock function with given fields: ctx, id
|
|
func (_m *Manager) DeleteGDPR(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) (*commonmodels.User, error) {
|
|
ret := _m.Called(ctx, id)
|
|
|
|
var r0 *commonmodels.User
|
|
if rf, ok := ret.Get(0).(func(context.Context, int) *commonmodels.User); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*commonmodels.User)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
|
|
r1 = rf(ctx, id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetByName provides a mock function with given fields: ctx, username
|
|
func (_m *Manager) GetByName(ctx context.Context, username string) (*commonmodels.User, error) {
|
|
ret := _m.Called(ctx, username)
|
|
|
|
var r0 *commonmodels.User
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *commonmodels.User); ok {
|
|
r0 = rf(ctx, username)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*commonmodels.User)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, username)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// List provides a mock function with given fields: ctx, query, options
|
|
func (_m *Manager) List(ctx context.Context, query *q.Query, options ...models.Option) (commonmodels.Users, error) {
|
|
_va := make([]interface{}, len(options))
|
|
for _i := range options {
|
|
_va[_i] = options[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, ctx, query)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
var r0 commonmodels.Users
|
|
if rf, ok := ret.Get(0).(func(context.Context, *q.Query, ...models.Option) commonmodels.Users); ok {
|
|
r0 = rf(ctx, query, options...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(commonmodels.Users)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, *q.Query, ...models.Option) error); ok {
|
|
r1 = rf(ctx, query, options...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MatchLocalPassword provides a mock function with given fields: ctx, username, password
|
|
func (_m *Manager) MatchLocalPassword(ctx context.Context, username string, password string) (*commonmodels.User, error) {
|
|
ret := _m.Called(ctx, username, password)
|
|
|
|
var r0 *commonmodels.User
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) *commonmodels.User); ok {
|
|
r0 = rf(ctx, username, password)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*commonmodels.User)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
|
r1 = rf(ctx, username, password)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Onboard provides a mock function with given fields: ctx, _a1
|
|
func (_m *Manager) Onboard(ctx context.Context, _a1 *commonmodels.User) error {
|
|
ret := _m.Called(ctx, _a1)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *commonmodels.User) error); ok {
|
|
r0 = rf(ctx, _a1)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// SetSysAdminFlag provides a mock function with given fields: ctx, id, admin
|
|
func (_m *Manager) SetSysAdminFlag(ctx context.Context, id int, admin bool) error {
|
|
ret := _m.Called(ctx, id, admin)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int, bool) error); ok {
|
|
r0 = rf(ctx, id, admin)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// UpdatePassword provides a mock function with given fields: ctx, id, newPassword
|
|
func (_m *Manager) UpdatePassword(ctx context.Context, id int, newPassword string) error {
|
|
ret := _m.Called(ctx, id, newPassword)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int, string) error); ok {
|
|
r0 = rf(ctx, id, newPassword)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// UpdateProfile provides a mock function with given fields: ctx, _a1, col
|
|
func (_m *Manager) UpdateProfile(ctx context.Context, _a1 *commonmodels.User, col ...string) error {
|
|
_va := make([]interface{}, len(col))
|
|
for _i := range col {
|
|
_va[_i] = col[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, ctx, _a1)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *commonmodels.User, ...string) error); ok {
|
|
r0 = rf(ctx, _a1, col...)
|
|
} 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
|
|
}
|