Documentation ¶
Overview ¶
FILE AUTOMATICALLY GENERATED. ADAPTER TO USE GENERICS
Package mktools is a generated GoMock package.
Index ¶
- Variables
- func AssertBadRequestError(t *testing.T, w *httptest.ResponseRecorder)
- func AssertDocumentNotFound(t *testing.T, w *httptest.ResponseRecorder)
- func AssertInternalServerError(t *testing.T, w *httptest.ResponseRecorder)
- func AssertUnauthorized(t *testing.T, w *httptest.ResponseRecorder)
- func ExpectFindOne[T any](coll *mockgen.MockCollection, userData *T, times int)
- func ExpectFindOneError(coll *mockgen.MockCollection, err error, times int)
- func ExpectHttpToken(mock *mockgen.MockHTTPClient, user *security.User)
- func ExpectHttpUnauthorized(mock *mockgen.MockHTTPClient)
- func ExpectInsertOne(coll *mockgen.MockCollection, times int)
- func ExpectInsertOneError(coll *mockgen.MockCollection, err error, times int)
- func ExpectUpdateOneError(coll *mockgen.MockCollection, err error, times int)
- func NewTestLogger(ctrl *gomock.Controller, withFieldCount int, errorCount int, infoCount int, ...) log.LogRusEntry
- func TestAdminUser() *security.User
- func TestGetRequest(url string, tokenString string) (*http.Request, *httptest.ResponseRecorder)
- func TestPostRequest(url string, body interface{}, tokenString string) (*http.Request, *httptest.ResponseRecorder)
- func TestUser() *security.User
- type MockCache
- type MockCacheMockRecorder
- type MockRabbitPublisher
- func (m *MockRabbitPublisher[T]) EXPECT() *MockRabbitPublisherMockRecorder[T]
- func (m *MockRabbitPublisher[T]) Logger() log.LogRusEntry
- func (m *MockRabbitPublisher[T]) Publish(data T) error
- func (m *MockRabbitPublisher[T]) PublishForResult(data T, exchange, routingKey string) error
- func (m *MockRabbitPublisher[T]) PublishTo(exchange, routingKey string, data T) error
- type MockRabbitPublisherMockRecorder
- func (mr *MockRabbitPublisherMockRecorder[T]) Logger() *gomock.Call
- func (mr *MockRabbitPublisherMockRecorder[T]) Publish(data interface{}) *gomock.Call
- func (mr *MockRabbitPublisherMockRecorder[T]) PublishForResult(data, exchange, routingKey interface{}) *gomock.Call
- func (mr *MockRabbitPublisherMockRecorder[T]) PublishTo(exchange, routingKey, data interface{}) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
var TestIsUniqueError = mongo.WriteException{ WriteErrors: []mongo.WriteError{ { Code: 11000, }, }, }
Mock Data
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 TestGetRequest ¶ added in v0.0.2
Requests Test functions
func TestPostRequest ¶ added in v0.0.2
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]) EXPECT ¶
func (m *MockCache[T]) EXPECT() *MockCacheMockRecorder[T]
EXPECT returns an object that allows the caller to indicate expected use.
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
func (m *MockRabbitPublisher[T]) EXPECT() *MockRabbitPublisherMockRecorder[T]
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.