mktools

package
v0.0.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2024 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Overview

FILE AUTOMATICALLY GENERATED. ADAPTER TO USE GENERICS

Package mktools is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var TestIsUniqueError = mongo.WriteException{
	WriteErrors: []mongo.WriteError{
		{
			Code: 11000,
		},
	},
}

Mock Data

View Source
var TestOtherDbError = mongo.WriteException{
	WriteErrors: []mongo.WriteError{
		{
			Code: 1,
		},
	},
}

Functions

func AssertBadRequestError added in v0.0.2

func AssertBadRequestError(t *testing.T, w *httptest.ResponseRecorder)

func AssertDocumentNotFound added in v0.0.2

func AssertDocumentNotFound(t *testing.T, w *httptest.ResponseRecorder)

func AssertInternalServerError added in v0.0.2

func AssertInternalServerError(t *testing.T, w *httptest.ResponseRecorder)

func AssertUnauthorized added in v0.0.2

func AssertUnauthorized(t *testing.T, w *httptest.ResponseRecorder)

Assertion Functions

func ExpectFindOne added in v0.0.3

func ExpectFindOne[T any](coll *mockgen.MockCollection, userData *T, times int)

func ExpectFindOneError

func ExpectFindOneError(coll *mockgen.MockCollection, err error, times int)

func ExpectHttpToken added in v0.0.11

func ExpectHttpToken(mock *mockgen.MockHTTPClient, user *security.User)

Http Mocks

func ExpectHttpUnauthorized added in v0.0.11

func ExpectHttpUnauthorized(mock *mockgen.MockHTTPClient)

func ExpectInsertOne

func ExpectInsertOne(coll *mockgen.MockCollection, times int)

func ExpectInsertOneError

func ExpectInsertOneError(coll *mockgen.MockCollection, err error, times int)

func ExpectUpdateOneError

func ExpectUpdateOneError(coll *mockgen.MockCollection, err error, times int)

func NewTestLogger

func NewTestLogger(ctrl *gomock.Controller, withFieldCount int, errorCount int, infoCount int, dataCount int, warnCount int, fatalCount int) log.LogRusEntry

func TestAdminUser added in v0.0.11

func TestAdminUser() *security.User

func TestGetRequest added in v0.0.2

func TestGetRequest(url string, tokenString string) (*http.Request, *httptest.ResponseRecorder)

Requests Test functions

func TestPostRequest added in v0.0.2

func TestPostRequest(url string, body interface{}, tokenString string) (*http.Request, *httptest.ResponseRecorder)

func TestUser added in v0.0.11

func TestUser() *security.User

Types

type MockCache

type MockCache[T any] struct {
	// contains filtered or unexported fields
}

MockCache is a mock of Cache interface.

func NewMockCache

func NewMockCache[T any](ctrl *gomock.Controller) *MockCache[T]

NewMockCache creates a new mock instance.

func (*MockCache[T]) Add

func (m *MockCache[T]) Add(key string, value *T) error

Add mocks base method.

func (*MockCache[T]) EXPECT

func (m *MockCache[T]) EXPECT() *MockCacheMockRecorder[T]

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCache[T]) Get

func (m *MockCache[T]) Get(key string) (*T, error)

Get mocks base method.

func (*MockCache[T]) Remove

func (m *MockCache[T]) Remove(key string)

Remove mocks base method.

type MockCacheMockRecorder

type MockCacheMockRecorder[T any] struct {
	// contains filtered or unexported fields
}

MockCacheMockRecorder is the mock recorder for MockCache.

func (*MockCacheMockRecorder[T]) Add

func (mr *MockCacheMockRecorder[T]) Add(key, value interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockCacheMockRecorder[T]) Get

func (mr *MockCacheMockRecorder[T]) Get(key interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockCacheMockRecorder[T]) Remove

func (mr *MockCacheMockRecorder[T]) Remove(key interface{}) *gomock.Call

Remove indicates an expected call of Remove.

type MockRabbitPublisher added in v0.0.4

type MockRabbitPublisher[T any] struct {
	// contains filtered or unexported fields
}

MockRabbitPublisher is a mock of RabbitPublisher interface.

func NewMockRabbitPublisher added in v0.0.4

func NewMockRabbitPublisher[T any](ctrl *gomock.Controller) *MockRabbitPublisher[T]

NewMockRabbitPublisher creates a new mock instance.

func (*MockRabbitPublisher[T]) EXPECT added in v0.0.4

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRabbitPublisher[T]) Logger added in v0.0.28

func (m *MockRabbitPublisher[T]) Logger() log.LogRusEntry

Logger mocks base method.

func (*MockRabbitPublisher[T]) Publish added in v0.0.4

func (m *MockRabbitPublisher[T]) Publish(data T) error

Publish mocks base method.

func (*MockRabbitPublisher[T]) PublishForResult added in v0.0.21

func (m *MockRabbitPublisher[T]) PublishForResult(data T, exchange, routingKey string) error

PublishForResult mocks base method.

func (*MockRabbitPublisher[T]) PublishTo added in v0.0.21

func (m *MockRabbitPublisher[T]) PublishTo(exchange, routingKey string, data T) error

PublishTo mocks base method.

type MockRabbitPublisherMockRecorder added in v0.0.4

type MockRabbitPublisherMockRecorder[T any] struct {
	// contains filtered or unexported fields
}

MockRabbitPublisherMockRecorder is the mock recorder for MockRabbitPublisher.

func (*MockRabbitPublisherMockRecorder[T]) Logger added in v0.0.28

func (mr *MockRabbitPublisherMockRecorder[T]) Logger() *gomock.Call

Logger indicates an expected call of Logger.

func (*MockRabbitPublisherMockRecorder[T]) Publish added in v0.0.4

func (mr *MockRabbitPublisherMockRecorder[T]) Publish(data interface{}) *gomock.Call

Publish indicates an expected call of Publish.

func (*MockRabbitPublisherMockRecorder[T]) PublishForResult added in v0.0.21

func (mr *MockRabbitPublisherMockRecorder[T]) PublishForResult(data, exchange, routingKey interface{}) *gomock.Call

PublishForResult indicates an expected call of PublishForResult.

func (*MockRabbitPublisherMockRecorder[T]) PublishTo added in v0.0.21

func (mr *MockRabbitPublisherMockRecorder[T]) PublishTo(exchange, routingKey, data interface{}) *gomock.Call

PublishTo indicates an expected call of PublishTo.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL