diff --git a/Makefile b/Makefile index eea65c02e..edb4d3a84 100644 --- a/Makefile +++ b/Makefile @@ -145,21 +145,21 @@ mocks: $(GOMOCK) rm -f */*/*_mock_test.go */*/mocks/* # See https://github.com/golang/mock for details - $(MOCKGEN) -package service -source crm/service/notification.go -destination crm/service/notification_mock_test.go + $(MOCKGEN) -package service -source crm/internal/service/notification.go -destination crm/internal/service/notification_mock_test.go - $(MOCKGEN) -package service -source messaging/service/attachment.go -destination messaging/service/attachment_mock_test.go - $(MOCKGEN) -package service -source messaging/service/channel.go -destination messaging/service/channel_mock_test.go - $(MOCKGEN) -package service -source messaging/service/message.go -destination messaging/service/message_mock_test.go - $(MOCKGEN) -package service -source system/service/organisation.go -destination system/service/organisation_mock_test.go - $(MOCKGEN) -package service -source system/service/role.go -destination system/service/role_mock_test.go - $(MOCKGEN) -package service -source system/service/user.go -destination system/service/user_mock_test.go + $(MOCKGEN) -package service -source messaging/internal/service/attachment.go -destination messaging/internal/service/attachment_mock_test.go + $(MOCKGEN) -package service -source messaging/internal/service/channel.go -destination messaging/internal/service/channel_mock_test.go + $(MOCKGEN) -package service -source messaging/internal/service/message.go -destination messaging/internal/service/message_mock_test.go + $(MOCKGEN) -package service -source system/internal/service/organisation.go -destination system/internal/service/organisation_mock_test.go + $(MOCKGEN) -package service -source system/internal/service/role.go -destination system/internal/service/role_mock_test.go + $(MOCKGEN) -package service -source system/internal/service/user.go -destination system/internal/service/user_mock_test.go $(MOCKGEN) -package mail -source internal/mail/mail.go -destination internal/mail/mail_mock_test.go $(MOCKGEN) -package rules -source internal/rules/interfaces.go -destination internal/rules/resources_mock_test.go - mkdir -p system/repository/mocks - $(MOCKGEN) -package repository -source system/repository/user.go -destination system/repository/mocks/user.go - $(MOCKGEN) -package repository -source system/repository/credentials.go -destination system/repository/mocks/credentials.go + mkdir -p system/internal/repository/mocks + $(MOCKGEN) -package repository -source system/internal/repository/user.go -destination system/internal/repository/mocks/user.go + $(MOCKGEN) -package repository -source system/internal/repository/credentials.go -destination system/internal/repository/mocks/credentials.go ######################################################################################################################## diff --git a/crm/internal/service/notification_mock_test.go b/crm/internal/service/notification_mock_test.go index 0f0cdbe05..b308a88ab 100644 --- a/crm/internal/service/notification_mock_test.go +++ b/crm/internal/service/notification_mock_test.go @@ -6,8 +6,6 @@ package service import ( context "context" - service0 "github.com/crusttech/crust/system/service" - types "github.com/crusttech/crust/system/types" gomock "github.com/golang/mock/gomock" mail_v2 "gopkg.in/mail.v2" reflect "reflect" @@ -76,51 +74,3 @@ func (mr *MockNotificationServiceMockRecorder) AttachEmailRecipients(message, fi varargs := append([]interface{}{message, field}, recipients...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttachEmailRecipients", reflect.TypeOf((*MockNotificationService)(nil).AttachEmailRecipients), varargs...) } - -// MocknotificationUserService is a mock of notificationUserService interface -type MocknotificationUserService struct { - ctrl *gomock.Controller - recorder *MocknotificationUserServiceMockRecorder -} - -// MocknotificationUserServiceMockRecorder is the mock recorder for MocknotificationUserService -type MocknotificationUserServiceMockRecorder struct { - mock *MocknotificationUserService -} - -// NewMocknotificationUserService creates a new mock instance -func NewMocknotificationUserService(ctrl *gomock.Controller) *MocknotificationUserService { - mock := &MocknotificationUserService{ctrl: ctrl} - mock.recorder = &MocknotificationUserServiceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MocknotificationUserService) EXPECT() *MocknotificationUserServiceMockRecorder { - return m.recorder -} - -// With mocks base method -func (m *MocknotificationUserService) With(ctx context.Context) service0.UserService { - ret := m.ctrl.Call(m, "With", ctx) - ret0, _ := ret[0].(service0.UserService) - return ret0 -} - -// With indicates an expected call of With -func (mr *MocknotificationUserServiceMockRecorder) With(ctx interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "With", reflect.TypeOf((*MocknotificationUserService)(nil).With), ctx) -} - -// FindByID mocks base method -func (m *MocknotificationUserService) FindByID(userID uint64) (*types.User, error) { - ret := m.ctrl.Call(m, "FindByID", userID) - ret0, _ := ret[0].(*types.User) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FindByID indicates an expected call of FindByID -func (mr *MocknotificationUserServiceMockRecorder) FindByID(userID interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByID", reflect.TypeOf((*MocknotificationUserService)(nil).FindByID), userID) -} diff --git a/system/internal/repository/mocks/credentials.go b/system/internal/repository/mocks/credentials.go index d8ba3095a..d4adeb99b 100644 --- a/system/internal/repository/mocks/credentials.go +++ b/system/internal/repository/mocks/credentials.go @@ -1,12 +1,12 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: system/repository/credentials.go +// Source: system/internal/repository/credentials.go // Package repository is a generated GoMock package. package repository import ( + repository "app/system/internal/repository" context "context" - repository "github.com/crusttech/crust/system/repository" types "github.com/crusttech/crust/system/types" gomock "github.com/golang/mock/gomock" factory "github.com/titpetric/factory" diff --git a/system/internal/repository/mocks/user.go b/system/internal/repository/mocks/user.go index b86917407..0c7b432e1 100644 --- a/system/internal/repository/mocks/user.go +++ b/system/internal/repository/mocks/user.go @@ -1,12 +1,12 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: system/repository/user.go +// Source: system/internal/repository/user.go // Package repository is a generated GoMock package. package repository import ( + repository "app/system/internal/repository" context "context" - repository "github.com/crusttech/crust/system/repository" types "github.com/crusttech/crust/system/types" gomock "github.com/golang/mock/gomock" factory "github.com/titpetric/factory"