From 9343970672c68e7f04fa2cbd07d2759014115db3 Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 16 Nov 2020 19:12:13 +0100 Subject: [PATCH] chore: fix cqrs tests --- cqrs/bus_test.go | 6 +++--- cqrs/middleware_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cqrs/bus_test.go b/cqrs/bus_test.go index 6093a9c..5385c29 100644 --- a/cqrs/bus_test.go +++ b/cqrs/bus_test.go @@ -10,7 +10,7 @@ type testCommandRequest struct { } func TestSimpleCommandExec(t *testing.T) { - bus := NewBus() + dispatcher := NewDispatcher() handlerCalled := false @@ -19,7 +19,7 @@ func TestSimpleCommandExec(t *testing.T) { return nil } - bus.RegisterCommand( + dispatcher.RegisterCommand( MatchCommandRequest(&testCommandRequest{}), CommandHandlerFunc(handleTestCommand), ) @@ -29,7 +29,7 @@ func TestSimpleCommandExec(t *testing.T) { } ctx := context.Background() - result, err := bus.Exec(ctx, cmd) + result, err := dispatcher.Exec(ctx, cmd) if err != nil { t.Error(err) } diff --git a/cqrs/middleware_test.go b/cqrs/middleware_test.go index bfde7b1..be21fce 100644 --- a/cqrs/middleware_test.go +++ b/cqrs/middleware_test.go @@ -6,7 +6,7 @@ import ( ) func TestBasicCommandMiddleware(t *testing.T) { - bus := NewBus() + dispatcher := NewDispatcher() handlerCalled := false @@ -26,7 +26,7 @@ func TestBasicCommandMiddleware(t *testing.T) { return CommandHandlerFunc(fn) } - bus.RegisterCommand( + dispatcher.RegisterCommand( MatchCommandRequest(&testCommandRequest{}), CommandHandlerFunc(handleTestCommand), commandMiddleware, @@ -37,7 +37,7 @@ func TestBasicCommandMiddleware(t *testing.T) { } ctx := context.Background() - result, err := bus.Exec(ctx, cmd) + result, err := dispatcher.Exec(ctx, cmd) if err != nil { t.Error(err) }