From e8145c15ff2cd68b6d53eebdec27c4e75f5fd525 Mon Sep 17 00:00:00 2001 From: Iraq Jaber Date: Mon, 11 Aug 2025 08:46:15 +0100 Subject: [PATCH] fixup! fixup! fixup! fix(projections): added check to make sure there cannot be 2 projections for the same table --- internal/query/projection/mock.go | 3 - internal/query/projection/projection_mock.go | 130 +++++++++++++++++++ 2 files changed, 130 insertions(+), 3 deletions(-) delete mode 100644 internal/query/projection/mock.go create mode 100644 internal/query/projection/projection_mock.go diff --git a/internal/query/projection/mock.go b/internal/query/projection/mock.go deleted file mode 100644 index 88cb350b9d..0000000000 --- a/internal/query/projection/mock.go +++ /dev/null @@ -1,3 +0,0 @@ -package projection - -//go:generate mockgen -source projection.go -destination ./projection_mock.go -package projection diff --git a/internal/query/projection/projection_mock.go b/internal/query/projection/projection_mock.go new file mode 100644 index 0000000000..6ba50082ae --- /dev/null +++ b/internal/query/projection/projection_mock.go @@ -0,0 +1,130 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: projection.go +// +// Generated by this command: +// +// mockgen -source projection.go -destination ./projection_mock.go -package projection +// + +// Package projection is a generated GoMock package. +package projection + +import ( + context "context" + reflect "reflect" + + eventstore "github.com/zitadel/zitadel/internal/eventstore" + handler "github.com/zitadel/zitadel/internal/eventstore/handler/v2" + gomock "go.uber.org/mock/gomock" +) + +// Mockprojection is a mock of projection interface. +type Mockprojection struct { + ctrl *gomock.Controller + recorder *MockprojectionMockRecorder +} + +// MockprojectionMockRecorder is the mock recorder for Mockprojection. +type MockprojectionMockRecorder struct { + mock *Mockprojection +} + +// NewMockprojection creates a new mock instance. +func NewMockprojection(ctrl *gomock.Controller) *Mockprojection { + mock := &Mockprojection{ctrl: ctrl} + mock.recorder = &MockprojectionMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *Mockprojection) EXPECT() *MockprojectionMockRecorder { + return m.recorder +} + +// Execute mocks base method. +func (m *Mockprojection) Execute(ctx context.Context, startedEvent eventstore.Event) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Execute", ctx, startedEvent) + ret0, _ := ret[0].(error) + return ret0 +} + +// Execute indicates an expected call of Execute. +func (mr *MockprojectionMockRecorder) Execute(ctx, startedEvent any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*Mockprojection)(nil).Execute), ctx, startedEvent) +} + +// Init mocks base method. +func (m *Mockprojection) Init(ctx context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Init", ctx) + ret0, _ := ret[0].(error) + return ret0 +} + +// Init indicates an expected call of Init. +func (mr *MockprojectionMockRecorder) Init(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*Mockprojection)(nil).Init), ctx) +} + +// ProjectionName mocks base method. +func (m *Mockprojection) ProjectionName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ProjectionName") + ret0, _ := ret[0].(string) + return ret0 +} + +// ProjectionName indicates an expected call of ProjectionName. +func (mr *MockprojectionMockRecorder) ProjectionName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProjectionName", reflect.TypeOf((*Mockprojection)(nil).ProjectionName)) +} + +// Start mocks base method. +func (m *Mockprojection) Start(ctx context.Context) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Start", ctx) +} + +// Start indicates an expected call of Start. +func (mr *MockprojectionMockRecorder) Start(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*Mockprojection)(nil).Start), ctx) +} + +// String mocks base method. +func (m *Mockprojection) String() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "String") + ret0, _ := ret[0].(string) + return ret0 +} + +// String indicates an expected call of String. +func (mr *MockprojectionMockRecorder) String() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "String", reflect.TypeOf((*Mockprojection)(nil).String)) +} + +// Trigger mocks base method. +func (m *Mockprojection) Trigger(ctx context.Context, opts ...handler.TriggerOpt) (context.Context, error) { + m.ctrl.T.Helper() + varargs := []any{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Trigger", varargs...) + ret0, _ := ret[0].(context.Context) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Trigger indicates an expected call of Trigger. +func (mr *MockprojectionMockRecorder) Trigger(ctx any, opts ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trigger", reflect.TypeOf((*Mockprojection)(nil).Trigger), varargs...) +}