Files
mtusi2026lab4/internal/transport/rest/mocks/SessionService.go
T
2026-10-15 20:45:29 +03:00

179 lines
4.8 KiB
Go

// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"mtusi-messenger/internal/domain"
"github.com/google/uuid"
mock "github.com/stretchr/testify/mock"
)
// NewMockSessionService creates a new instance of MockSessionService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockSessionService(t interface {
mock.TestingT
Cleanup(func())
}) *MockSessionService {
if helper, ok := t.(interface{ Helper() }); ok {
helper.Helper()
}
mock := &MockSessionService{}
mock.Mock.Test(t)
t.Cleanup(func() {
if helper, ok := t.(interface{ Helper() }); ok {
helper.Helper()
}
mock.AssertExpectations(t)
})
return mock
}
// MockSessionService is an autogenerated mock type for the SessionService type
type MockSessionService struct {
mock.Mock
}
type MockSessionService_Expecter struct {
mock *mock.Mock
}
func (_m *MockSessionService) EXPECT() *MockSessionService_Expecter {
return &MockSessionService_Expecter{mock: &_m.Mock}
}
// Create provides a mock function for the type MockSessionService
func (_mock *MockSessionService) Create(ctx context.Context, user domain.User) (domain.Session, error) {
ret := _mock.Called(ctx, user)
if len(ret) == 0 {
panic("no return value specified for Create")
}
var r0 domain.Session
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.User) (domain.Session, error)); ok {
return returnFunc(ctx, user)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.User) domain.Session); ok {
r0 = returnFunc(ctx, user)
} else {
r0 = ret.Get(0).(domain.Session)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, domain.User) error); ok {
r1 = returnFunc(ctx, user)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockSessionService_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
type MockSessionService_Create_Call struct {
*mock.Call
}
// Create is a helper method to define mock.On call
// - ctx context.Context
// - user domain.User
func (_e *MockSessionService_Expecter) Create(ctx any, user any) *MockSessionService_Create_Call {
return &MockSessionService_Create_Call{Call: _e.mock.On("Create", ctx, user)}
}
func (_c *MockSessionService_Create_Call) Run(run func(ctx context.Context, user domain.User)) *MockSessionService_Create_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 domain.User
if args[1] != nil {
arg1 = args[1].(domain.User)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockSessionService_Create_Call) Return(session domain.Session, err error) *MockSessionService_Create_Call {
_c.Call.Return(session, err)
return _c
}
func (_c *MockSessionService_Create_Call) RunAndReturn(run func(ctx context.Context, user domain.User) (domain.Session, error)) *MockSessionService_Create_Call {
_c.Call.Return(run)
return _c
}
// Revoke provides a mock function for the type MockSessionService
func (_mock *MockSessionService) Revoke(ctx context.Context, userID uuid.UUID, token string) error {
ret := _mock.Called(ctx, userID, token)
if len(ret) == 0 {
panic("no return value specified for Revoke")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID, string) error); ok {
r0 = returnFunc(ctx, userID, token)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockSessionService_Revoke_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revoke'
type MockSessionService_Revoke_Call struct {
*mock.Call
}
// Revoke is a helper method to define mock.On call
// - ctx context.Context
// - userID uuid.UUID
// - token string
func (_e *MockSessionService_Expecter) Revoke(ctx any, userID any, token any) *MockSessionService_Revoke_Call {
return &MockSessionService_Revoke_Call{Call: _e.mock.On("Revoke", ctx, userID, token)}
}
func (_c *MockSessionService_Revoke_Call) Run(run func(ctx context.Context, userID uuid.UUID, token string)) *MockSessionService_Revoke_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 uuid.UUID
if args[1] != nil {
arg1 = args[1].(uuid.UUID)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockSessionService_Revoke_Call) Return(err error) *MockSessionService_Revoke_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockSessionService_Revoke_Call) RunAndReturn(run func(ctx context.Context, userID uuid.UUID, token string) error) *MockSessionService_Revoke_Call {
_c.Call.Return(run)
return _c
}