Skip to content

Commit aceeab0

Browse files
committed
Fixed tests
1 parent a97aa7d commit aceeab0

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

cmd/goengine/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"context"
5+
"errors"
56
"os"
67
"time"
78

@@ -19,6 +20,13 @@ func main() {
1920
var streamName goengine.StreamName = "test"
2021

2122
mongoDSN := os.Getenv("STORAGE_DSN")
23+
if len(mongoDSN) == 0 {
24+
panic(errors.New("missing STORAGE_DSN environment variable"))
25+
}
26+
brokerDSN := os.Getenv("BROKER_DSN")
27+
if len(mongoDSN) == 0 {
28+
panic(errors.New("missing BROKER_DSN environment variable"))
29+
}
2230

2331
goengine.Log("Connecting to the database", map[string]interface{}{"dsn": mongoDSN}, nil)
2432
mongoClient, err := mongo.NewClientWithOptions(
@@ -56,8 +64,6 @@ func main() {
5664
registry.RegisterType(&RecipeCreated{})
5765
registry.RegisterType(&RecipeRated{})
5866

59-
// bus := inmemory.NewInMemoryEventBus()
60-
brokerDSN := os.Getenv("BROKER_DSN")
6167
goengine.Log("Setting up the event bus", map[string]interface{}{"dsn": brokerDSN}, nil)
6268
bus := rabbit.NewEventBus(brokerDSN, "events", "events")
6369

docker-compose.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ version: '2'
22
services:
33

44
rabbitmq:
5-
image: rabbitmq:3.6.1-management
5+
image: rabbitmq:3-management-alpine
66
ports:
77
- "15672:15672"
88
- "5672:5672"
9-
10-
redis:
11-
image: redis
129

1310
mongo:
14-
image: mongo
15-
ports:
16-
- "27017:27017"
11+
image: mongo
12+
ports:
13+
- "27017:27017"

inmemory/eventstore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var _ = Describe("In Memory Event Store", func() {
4141
})
4242

4343
It("should count the events that happened", func() {
44-
Expect(inMemory.CountEventsFor(streamName, aggregateId)).Should(Equal(4))
44+
Expect(inMemory.CountEventsFor(streamName, aggregateId)).Should(Equal(int64(4)))
4545
})
4646

4747
It("should retrieve events for version bigger then 1", func() {

0 commit comments

Comments
 (0)