{"action":"opened","issue":{"url":"https://api.github.com/repos/looplab/eventhorizon/issues/218","repository_url":"https://api.github.com/repos/looplab/eventhorizon","labels_url":"https://api.github.com/repos/looplab/eventhorizon/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/looplab/eventhorizon/issues/218/comments","events_url":"https://api.github.com/repos/looplab/eventhorizon/issues/218/events","html_url":"https://github.com/looplab/eventhorizon/issues/218","id":348871087,"node_id":"MDU6SXNzdWUzNDg4NzEwODc=","number":218,"title":"Vendor Problem","user":{"login":"kmacmcfarlane","id":6218254,"node_id":"MDQ6VXNlcjYyMTgyNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6218254?v=4","gravatar_id":"","url":"https://api.github.com/users/kmacmcfarlane","html_url":"https://github.com/kmacmcfarlane","followers_url":"https://api.github.com/users/kmacmcfarlane/followers","following_url":"https://api.github.com/users/kmacmcfarlane/following{/other_user}","gists_url":"https://api.github.com/users/kmacmcfarlane/gists{/gist_id}","starred_url":"https://api.github.com/users/kmacmcfarlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmacmcfarlane/subscriptions","organizations_url":"https://api.github.com/users/kmacmcfarlane/orgs","repos_url":"https://api.github.com/users/kmacmcfarlane/repos","events_url":"https://api.github.com/users/kmacmcfarlane/events{/privacy}","received_events_url":"https://api.github.com/users/kmacmcfarlane/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-08T20:01:25Z","updated_at":"2018-08-08T20:01:25Z","closed_at":null,"author_association":"NONE","body":"I am trying to use the in-memory implementations of EventStore, etc. in a unit test. When I try to compile the test, I get an error that the EventStore interface is looking for a vendored version of eventhorizon.UUID in EventStore's Load() and ReadWriteRepo's Find method. Is this an issue with the library or something I'm doing?\r\n\r\n```\r\n# github.com/Rewardable/rewardable_apiv2/tests_integration\r\ntests_integration/cqrs_user_activity_test.go:41:22: cannot use eventStore (type *\"github.com/looplab/eventhorizon/eventstore/memory\".EventStore) as type \"github.com/Rewardable/rewardable_apiv2/vendor/github.com/looplab/eventhorizon\".EventStore in argument to user_activity.Setup:\r\n        *\"github.com/looplab/eventhorizon/eventstore/memory\".EventStore does not implement \"github.com/Rewardable/rewardable_apiv2/vendor/github.com/looplab/eventhorizon\".EventStore (wrong type for Load method)\r\n                have Load(context.Context, \"github.com/looplab/eventhorizon\".UUID) ([]\"github.com/looplab/eventhorizon\".Event, error)\r\n                want Load(context.Context, \"github.com/Rewardable/rewardable_apiv2/vendor/github.com/looplab/eventhorizon\".UUID) ([]\"github.com/Rewardable/rewardable_apiv2/vendor/github.com/looplab/eventhorizon\".Event, error)\r\ntests_integration/cqrs_user_activity_test.go:41:22: cannot use userViewRepository (type *\"github.com/looplab/eventhorizon/repo/memory\".Repo) as type \"github.com/Rewardable/rewardable_apiv2/vendor/github.com/looplab/eventhorizon\".ReadWriteRepo in argument to user_activity.Setup:\r\n        *\"github.com/looplab/eventhorizon/repo/memory\".Repo does not implement \"github.com/Rewardable/rewardable_apiv2/vendor/github.com/looplab/eventhorizon\".ReadWriteRepo (wrong type for Find method)\r\n                have Find(context.Context, \"github.com/looplab/eventhorizon\".UUID) (\"github.com/looplab/eventhorizon\".Entity, error)\r\n                want Find(context.Context, \"github.com/Rewardable/rewardable_apiv2/vendor/github.com/looplab/eventhorizon\".UUID) (\"github.com/Rewardable/rewardable_apiv2/vendor/github.com/looplab/eventhorizon\".Entity, error)\r\ntests_integration/cqrs_user_activity_test.go:51:4: not enough arguments in call to gomega.Ω\r\n        have ()\r\n        want (interface {}, ...interface {})\r\nFAIL    github.com/Rewardable/rewardable_apiv2/tests_integration [build failed]\r\n```\r\n\r\nSource Snippets:\r\n\r\ncqrs_user_activity_test.go:\r\n```\r\npackage tests_integration\r\n\r\nimport (\r\n\t. \"github.com/onsi/ginkgo\"\r\n\t. \"github.com/onsi/gomega\"\r\n\t\"github.com/sirupsen/logrus\"\r\n\t\"github.com/looplab/eventhorizon/eventbus/local\"\r\n\t\"github.com/looplab/eventhorizon/commandhandler/bus\"\r\n\t\"github.com/looplab/eventhorizon/eventstore/memory\"\r\n\t\"github.com/Rewardable/rewardable_apiv2/cqrs/user_activity\"\r\n\tmemory2 \"github.com/looplab/eventhorizon/repo/memory\"\r\n\tlocal2 \"github.com/looplab/eventhorizon/publisher/local\"\r\n\t\"github.com/Rewardable/rewardable_apiv2/tests/mocks\"\r\n)\r\nvar _ = Describe(\"User Activity Domain\", func(){\r\n\r\n\tvar (\r\n\t\tactivityRepository *mocks.ActivityRepository\r\n\t\teventStore *memory.EventStore\r\n\t)\r\n\r\n\tBeforeEach(func(){\r\n\r\n\t\t// Buses and publishers\r\n\t\teventStore = memory.NewEventStore()\r\n\r\n\t\teventBus := local.NewEventBus()\r\n\r\n\t\tcommandBus := bus.NewCommandHandler()\r\n\r\n\t\teventPublisher := local2.NewEventPublisher()\r\n\r\n\t\tuserViewRepository := memory2.NewRepo()\r\n\r\n\t\t// Activity repository\r\n\t\tactivityRepository = new(mocks.ActivityRepository)\r\n\r\n\t\tlogger := logrus.New()\r\n\r\n\t\t// Set up the framework\r\n\t\tuser_activity.Setup(\r\n\t\t\teventStore,\r\n\t\t\teventBus,\r\n\t\t\tcommandBus,\r\n\t\t\teventPublisher,\r\n\t\t\tuserViewRepository,\r\n\t\t\tactivityRepository,\r\n\t\t\tlogger)\r\n\t})\r\n\r\n})\r\n```\r\n```\r\npackage user_activity\r\n\r\nimport (\r\n\t\"github.com/looplab/eventhorizon/commandhandler/bus\"\r\n\t\"github.com/looplab/eventhorizon/aggregatestore/events\"\r\n\r\n\t\"github.com/looplab/eventhorizon/eventhandler/projector\"\r\n\t\"github.com/looplab/eventhorizon\"\r\n\t\"github.com/looplab/eventhorizon/commandhandler/aggregate\"\r\n\taggregate2 \"github.com/Rewardable/rewardable_apiv2/cqrs/user_activity/write\"\r\n\t\"github.com/Rewardable/rewardable_apiv2/cqrs/user_activity/view\"\r\n\t\"github.com/Rewardable/rewardable_apiv2/cqrs/user_activity/event\"\r\n\t\"github.com/sirupsen/logrus\"\r\n\t\"github.com/Rewardable/rewardable_apiv2/repository\"\r\n)\r\n\r\n// Setup configures the domain.\r\nfunc Setup(\r\n\teventStore eventhorizon.EventStore,\r\n\teventBus eventhorizon.EventBus,\r\n\tcommandBus *bus.CommandHandler,\r\n\teventPublisher eventhorizon.EventPublisher,\r\n\tuserViewRepository eventhorizon.ReadWriteRepo,\r\n\tactivityRepository repository.ActivityRepository,\r\n\tlogger *logrus.Logger) (err error) {\r\n\r\n\t// Log events\r\n\teventPublisher.AddObserver(&Logger{})\r\n\teventBus.AddHandler(eventhorizon.MatchAny(), eventPublisher)\r\n\r\n\t// Create the aggregate repository.\r\n\taggregateStore, err := events.NewAggregateStore(eventStore, eventBus)\r\n\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\t// Create the aggregate command handler and register the commands it handles.\r\n\tuserHandler, err := aggregate.NewCommandHandler(aggregate2.UserAggregateType, aggregateStore)\r\n\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\t// TODO: setup in command package?\r\n\tcommandHandler := eventhorizon.UseCommandHandlerMiddleware(userHandler, LoggingMiddleware)\r\n\tcommandBus.SetHandler(commandHandler, aggregate2.CommandTypeStartActivity)\r\n\tcommandBus.SetHandler(commandHandler, aggregate2.CommandTypeFinishActivity)\r\n\r\n\t// Create and register a read model for user views\r\n\tuserProjector := view.NewUserProjector(activityRepository, logger)\r\n\teventHandler := projector.NewEventHandler(userProjector, userViewRepository)\r\n\r\n\teventHandler.SetEntityFactory(func() eventhorizon.Entity { return &view.UserView{} })\r\n\r\n\t// TODO: setup in event package?\r\n\teventBus.AddHandler(eventhorizon.MatchAnyEventOf(\r\n\t\tevent.ActivityStarted,\r\n\t\tevent.ActivityFinished,\r\n\t), eventHandler)\r\n\r\n\treturn err\r\n}\r\n```"}}
{"actor":{"display_login":"kmacmcfarlane"}}