Documentation
¶
Overview ¶
Package mocks is a generated GoMock package.
Index ¶
- func BuildTestUserConnection(users []*user.UserDTO, hasNextPage, hasPreviousPage bool) *user.UserConnectionDTO
- func CommonTestContext() context.Context
- type MockService
- func (m *MockService) CreateUser(ctx context.Context, req user.CreateUserRequest) (*user.CreateUserResponse, error)
- func (m *MockService) DeleteUser(ctx context.Context, req user.DeleteUserRequest) (*user.DeleteUserResponse, error)
- func (m *MockService) EXPECT() *MockServiceMockRecorder
- func (m *MockService) GetUser(ctx context.Context, req user.GetUserRequest) (*user.GetUserResponse, error)
- func (m *MockService) ListUsers(ctx context.Context, req user.ListUsersRequest) (*user.ListUsersResponse, error)
- func (m *MockService) UpdateUser(ctx context.Context, req user.UpdateUserRequest) (*user.UpdateUserResponse, error)
- type MockServiceMockRecorder
- func (mr *MockServiceMockRecorder) CreateUser(ctx, req interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) DeleteUser(ctx, req interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) GetUser(ctx, req interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) ListUsers(ctx, req interface{}) *gomock.Call
- func (mr *MockServiceMockRecorder) UpdateUser(ctx, req interface{}) *gomock.Call
- type ServiceTestUtils
- func (u *ServiceTestUtils) ExpectCreateUserDuplicateEmail(email, name string)
- func (u *ServiceTestUtils) ExpectCreateUserSuccess(email, name string, returnUser *user.UserDTO)
- func (u *ServiceTestUtils) ExpectDeleteUserNotFound(userID string)
- func (u *ServiceTestUtils) ExpectDeleteUserSuccess(userID string)
- func (u *ServiceTestUtils) ExpectGetUserNotFound(userID string)
- func (u *ServiceTestUtils) ExpectGetUserSuccess(userID string, returnUser *user.UserDTO)
- func (u *ServiceTestUtils) ExpectListUsersSuccess(first int, after string, returnUsers *user.UserConnectionDTO)
- func (u *ServiceTestUtils) ExpectUpdateUserNotFound(userID string, email, name *string)
- func (u *ServiceTestUtils) ExpectUpdateUserSuccess(userID string, email, name *string, returnUser *user.UserDTO)
- type TestDTOBuilder
- func (b *TestDTOBuilder) BuildUserDTO() *user.UserDTO
- func (b *TestDTOBuilder) BuildUserEdgeDTO() *user.UserEdgeDTO
- func (b *TestDTOBuilder) WithCreatedAt(createdAt time.Time) *TestDTOBuilder
- func (b *TestDTOBuilder) WithEmail(email string) *TestDTOBuilder
- func (b *TestDTOBuilder) WithID(id string) *TestDTOBuilder
- func (b *TestDTOBuilder) WithName(name string) *TestDTOBuilder
- func (b *TestDTOBuilder) WithUpdatedAt(updatedAt time.Time) *TestDTOBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTestUserConnection ¶
func BuildTestUserConnection(users []*user.UserDTO, hasNextPage, hasPreviousPage bool) *user.UserConnectionDTO
BuildTestUserConnection creates a test user connection with the given users
func CommonTestContext ¶
CommonTestContext provides a common test context with timeout
Types ¶
type MockService ¶
type MockService struct {
// contains filtered or unexported fields
}
MockService is a mock of Service interface.
func NewMockService ¶
func NewMockService(ctrl *gomock.Controller) *MockService
NewMockService creates a new mock instance.
func (*MockService) CreateUser ¶
func (m *MockService) CreateUser(ctx context.Context, req user.CreateUserRequest) (*user.CreateUserResponse, error)
CreateUser mocks base method.
func (*MockService) DeleteUser ¶
func (m *MockService) DeleteUser(ctx context.Context, req user.DeleteUserRequest) (*user.DeleteUserResponse, error)
DeleteUser mocks base method.
func (*MockService) EXPECT ¶
func (m *MockService) EXPECT() *MockServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockService) GetUser ¶
func (m *MockService) GetUser(ctx context.Context, req user.GetUserRequest) (*user.GetUserResponse, error)
GetUser mocks base method.
func (*MockService) ListUsers ¶
func (m *MockService) ListUsers(ctx context.Context, req user.ListUsersRequest) (*user.ListUsersResponse, error)
ListUsers mocks base method.
func (*MockService) UpdateUser ¶
func (m *MockService) UpdateUser(ctx context.Context, req user.UpdateUserRequest) (*user.UpdateUserResponse, error)
UpdateUser mocks base method.
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService.
func (*MockServiceMockRecorder) CreateUser ¶
func (mr *MockServiceMockRecorder) CreateUser(ctx, req interface{}) *gomock.Call
CreateUser indicates an expected call of CreateUser.
func (*MockServiceMockRecorder) DeleteUser ¶
func (mr *MockServiceMockRecorder) DeleteUser(ctx, req interface{}) *gomock.Call
DeleteUser indicates an expected call of DeleteUser.
func (*MockServiceMockRecorder) GetUser ¶
func (mr *MockServiceMockRecorder) GetUser(ctx, req interface{}) *gomock.Call
GetUser indicates an expected call of GetUser.
func (*MockServiceMockRecorder) ListUsers ¶
func (mr *MockServiceMockRecorder) ListUsers(ctx, req interface{}) *gomock.Call
ListUsers indicates an expected call of ListUsers.
func (*MockServiceMockRecorder) UpdateUser ¶
func (mr *MockServiceMockRecorder) UpdateUser(ctx, req interface{}) *gomock.Call
UpdateUser indicates an expected call of UpdateUser.
type ServiceTestUtils ¶
type ServiceTestUtils struct {
// contains filtered or unexported fields
}
ServiceTestUtils provides common mock service setup utilities
func NewServiceTestUtils ¶
func NewServiceTestUtils(mockService *MockService) *ServiceTestUtils
NewServiceTestUtils creates a new service test utilities instance
func (*ServiceTestUtils) ExpectCreateUserDuplicateEmail ¶
func (u *ServiceTestUtils) ExpectCreateUserDuplicateEmail(email, name string)
ExpectCreateUserDuplicateEmail sets up mock to return duplicate email error
func (*ServiceTestUtils) ExpectCreateUserSuccess ¶
func (u *ServiceTestUtils) ExpectCreateUserSuccess(email, name string, returnUser *user.UserDTO)
ExpectCreateUserSuccess sets up mock to create user successfully
func (*ServiceTestUtils) ExpectDeleteUserNotFound ¶
func (u *ServiceTestUtils) ExpectDeleteUserNotFound(userID string)
ExpectDeleteUserNotFound sets up mock to return user not found error for deletion
func (*ServiceTestUtils) ExpectDeleteUserSuccess ¶
func (u *ServiceTestUtils) ExpectDeleteUserSuccess(userID string)
ExpectDeleteUserSuccess sets up mock to delete user successfully
func (*ServiceTestUtils) ExpectGetUserNotFound ¶
func (u *ServiceTestUtils) ExpectGetUserNotFound(userID string)
ExpectGetUserNotFound sets up mock to return user not found error
func (*ServiceTestUtils) ExpectGetUserSuccess ¶
func (u *ServiceTestUtils) ExpectGetUserSuccess(userID string, returnUser *user.UserDTO)
ExpectGetUserSuccess sets up mock to return a user successfully
func (*ServiceTestUtils) ExpectListUsersSuccess ¶
func (u *ServiceTestUtils) ExpectListUsersSuccess(first int, after string, returnUsers *user.UserConnectionDTO)
ExpectListUsersSuccess sets up mock to return users list successfully
func (*ServiceTestUtils) ExpectUpdateUserNotFound ¶
func (u *ServiceTestUtils) ExpectUpdateUserNotFound(userID string, email, name *string)
ExpectUpdateUserNotFound sets up mock to return user not found error for update
func (*ServiceTestUtils) ExpectUpdateUserSuccess ¶
func (u *ServiceTestUtils) ExpectUpdateUserSuccess(userID string, email, name *string, returnUser *user.UserDTO)
ExpectUpdateUserSuccess sets up mock to update user successfully
type TestDTOBuilder ¶
type TestDTOBuilder struct {
// contains filtered or unexported fields
}
TestDTOBuilder helps create test DTOs with common configurations
func NewTestDTOBuilder ¶
func NewTestDTOBuilder() *TestDTOBuilder
NewTestDTOBuilder creates a new test DTO builder with default values
func (*TestDTOBuilder) BuildUserDTO ¶
func (b *TestDTOBuilder) BuildUserDTO() *user.UserDTO
BuildUserDTO creates a UserDTO with the configured values
func (*TestDTOBuilder) BuildUserEdgeDTO ¶
func (b *TestDTOBuilder) BuildUserEdgeDTO() *user.UserEdgeDTO
BuildUserEdgeDTO creates a UserEdgeDTO with the configured values
func (*TestDTOBuilder) WithCreatedAt ¶
func (b *TestDTOBuilder) WithCreatedAt(createdAt time.Time) *TestDTOBuilder
WithCreatedAt sets the created at timestamp
func (*TestDTOBuilder) WithEmail ¶
func (b *TestDTOBuilder) WithEmail(email string) *TestDTOBuilder
WithEmail sets the user email
func (*TestDTOBuilder) WithID ¶
func (b *TestDTOBuilder) WithID(id string) *TestDTOBuilder
WithID sets the user ID
func (*TestDTOBuilder) WithName ¶
func (b *TestDTOBuilder) WithName(name string) *TestDTOBuilder
WithName sets the user name
func (*TestDTOBuilder) WithUpdatedAt ¶
func (b *TestDTOBuilder) WithUpdatedAt(updatedAt time.Time) *TestDTOBuilder
WithUpdatedAt sets the updated at timestamp