|
|
@ -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) |
|
|
|
} |
|
|
|