mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-14 17:33:17 +00:00
Changes (#195)
* Changes added * Reading of events for applications changed. * Proto changed * Tests added * Added more tests. * Struct for Data expanded with additional fields. * refactoring * Changes from review. * Merge in to Master * Changes from review. * fix: generate proto Co-authored-by: Fabiennne <fabienne.gerschwiler@gmail.com>
This commit is contained in:
@@ -2,9 +2,10 @@ package eventsourcing
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/caos/zitadel/internal/id"
|
||||
"time"
|
||||
|
||||
"github.com/caos/zitadel/internal/id"
|
||||
|
||||
mock_cache "github.com/caos/zitadel/internal/cache/mock"
|
||||
"github.com/caos/zitadel/internal/crypto"
|
||||
"github.com/caos/zitadel/internal/eventstore/mock"
|
||||
@@ -456,3 +457,34 @@ func GetMockManipulateUserNoEventsWithPw(ctrl *gomock.Controller) *UserEventstor
|
||||
mockEs.EXPECT().PushAggregates(gomock.Any(), gomock.Any()).Return(nil)
|
||||
return GetMockedEventstoreWithPw(ctrl, mockEs, false, false, false, true)
|
||||
}
|
||||
|
||||
func GetMockedEventstoreComplexity(ctrl *gomock.Controller, mockEs *mock.MockEventstore) *UserEventstore {
|
||||
return &UserEventstore{
|
||||
Eventstore: mockEs,
|
||||
}
|
||||
}
|
||||
|
||||
func GetMockChangesUserOK(ctrl *gomock.Controller) *UserEventstore {
|
||||
user := model.Profile{
|
||||
FirstName: "Hans",
|
||||
LastName: "Muster",
|
||||
UserName: "HansMuster",
|
||||
}
|
||||
data, err := json.Marshal(user)
|
||||
if err != nil {
|
||||
|
||||
}
|
||||
events := []*es_models.Event{
|
||||
&es_models.Event{AggregateID: "AggregateID", Sequence: 1, AggregateType: model.UserAggregate, Data: data},
|
||||
}
|
||||
mockEs := mock.NewMockEventstore(ctrl)
|
||||
mockEs.EXPECT().FilterEvents(gomock.Any(), gomock.Any()).Return(events, nil)
|
||||
return GetMockedEventstoreComplexity(ctrl, mockEs)
|
||||
}
|
||||
|
||||
func GetMockChangesUserNoEvents(ctrl *gomock.Controller) *UserEventstore {
|
||||
events := []*es_models.Event{}
|
||||
mockEs := mock.NewMockEventstore(ctrl)
|
||||
mockEs.EXPECT().FilterEvents(gomock.Any(), gomock.Any()).Return(events, nil)
|
||||
return GetMockedEventstoreComplexity(ctrl, mockEs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user