Skip to content

Commit 3efbb33

Browse files
committed
Fixed unit test
Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
1 parent 9353d41 commit 3efbb33

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

service/sharddistributor/canary/module_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"go.uber.org/fx"
1010
"go.uber.org/fx/fxtest"
1111
"go.uber.org/yarpc"
12+
"go.uber.org/yarpc/api/peer"
1213
"go.uber.org/yarpc/api/transport/transporttest"
1314
"go.uber.org/yarpc/transport/grpc"
1415
"go.uber.org/yarpc/yarpctest"
@@ -44,9 +45,14 @@ func TestModule(t *testing.T) {
4445
},
4546
}
4647

47-
// Create a mock dispatcher
48+
// Create a mock dispatcher with the required outbound
4849
dispatcher := yarpc.NewDispatcher(yarpc.Config{
4950
Name: "test-canary",
51+
Outbounds: yarpc.Outbounds{
52+
"shard-distributor-canary": {
53+
Unary: outbound,
54+
},
55+
},
5056
})
5157

5258
// Create a test app with the library, check that it starts and stops
@@ -56,9 +62,9 @@ func TestModule(t *testing.T) {
5662
fx.Annotate(clock.NewMockedTimeSource(), fx.As(new(clock.TimeSource))),
5763
fx.Annotate(log.NewNoop(), fx.As(new(log.Logger))),
5864
fx.Annotate(mockClientConfigProvider, fx.As(new(yarpc.ClientConfig))),
65+
fx.Annotate(transport, fx.As(new(peer.Transport))),
5966
zaptest.NewLogger(t),
6067
config,
61-
transport,
6268
dispatcher,
6369
),
6470
Module(NamespacesNames{FixedNamespace: "shard-distributor-canary", EphemeralNamespace: "shard-distributor-canary-ephemeral", ExternalAssignmentNamespace: "test-external-assignment", SharddistributorServiceName: "cadence-shard-distributor"}),

0 commit comments

Comments
 (0)