This commit is contained in:
+12
-12
@@ -220,7 +220,7 @@ func TestRouteDispatchesStoreAndCheck(t *testing.T) {
|
||||
{Destination: dest, Payload: []byte("routed msg")},
|
||||
},
|
||||
}
|
||||
resp, err := router.Route(storeReq)
|
||||
resp, err := router.Route(context.Background(),storeReq)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "route-store-uuid", resp.UuidAck)
|
||||
|
||||
@@ -230,7 +230,7 @@ func TestRouteDispatchesStoreAndCheck(t *testing.T) {
|
||||
{LookupKey: dest},
|
||||
},
|
||||
}
|
||||
resp, err = router.Route(pullReq)
|
||||
resp, err = router.Route(context.Background(),pullReq)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, resp.Chat, 1)
|
||||
assert.Equal(t, []byte("routed msg"), resp.Chat[0].Payload)
|
||||
@@ -241,7 +241,7 @@ func TestRouteEmptyMessage(t *testing.T) {
|
||||
router, mr := newTestRouter(t)
|
||||
defer mr.Close()
|
||||
|
||||
resp, err := router.Route(&meowlib.ToServerMessage{})
|
||||
resp, err := router.Route(context.Background(),&meowlib.ToServerMessage{})
|
||||
assert.NoError(t, err)
|
||||
assert.Nil(t, resp)
|
||||
}
|
||||
@@ -251,9 +251,9 @@ func TestRouteIncrementsTotalCounter(t *testing.T) {
|
||||
router, mr := newTestRouter(t)
|
||||
defer mr.Close()
|
||||
|
||||
router.Route(&meowlib.ToServerMessage{})
|
||||
router.Route(&meowlib.ToServerMessage{})
|
||||
router.Route(&meowlib.ToServerMessage{})
|
||||
router.Route(context.Background(),&meowlib.ToServerMessage{})
|
||||
router.Route(context.Background(),&meowlib.ToServerMessage{})
|
||||
router.Route(context.Background(),&meowlib.ToServerMessage{})
|
||||
|
||||
val, err := router.Client.Get("statistics:messages:total").Int()
|
||||
assert.NoError(t, err)
|
||||
@@ -554,7 +554,7 @@ func TestRouteMatriochka(t *testing.T) {
|
||||
Data: []byte("wrapped"),
|
||||
},
|
||||
}
|
||||
resp, err := router.Route(msg)
|
||||
resp, err := router.Route(context.Background(),msg)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "route-mtk", resp.UuidAck)
|
||||
|
||||
@@ -578,7 +578,7 @@ func TestRouteInvitation(t *testing.T) {
|
||||
ShortcodeLen: 6,
|
||||
},
|
||||
}
|
||||
resp, err := router.Route(msg)
|
||||
resp, err := router.Route(context.Background(),msg)
|
||||
assert.NoError(t, err)
|
||||
assert.NotEmpty(t, resp.Invitation.Shortcode)
|
||||
assert.Len(t, resp.Invitation.Shortcode, 6)
|
||||
@@ -595,7 +595,7 @@ func TestStatisticsCountersIncrement(t *testing.T) {
|
||||
dest := "stats-dest"
|
||||
|
||||
// one store increments usermessages
|
||||
router.Route(&meowlib.ToServerMessage{
|
||||
router.Route(context.Background(),&meowlib.ToServerMessage{
|
||||
Messages: []*meowlib.PackedUserMessage{
|
||||
{Destination: dest, Payload: []byte("x")},
|
||||
},
|
||||
@@ -604,7 +604,7 @@ func TestStatisticsCountersIncrement(t *testing.T) {
|
||||
assert.Equal(t, 1, val)
|
||||
|
||||
// one pull increments messagelookups
|
||||
router.Route(&meowlib.ToServerMessage{
|
||||
router.Route(context.Background(),&meowlib.ToServerMessage{
|
||||
PullRequest: []*meowlib.ConversationRequest{
|
||||
{LookupKey: dest},
|
||||
},
|
||||
@@ -613,14 +613,14 @@ func TestStatisticsCountersIncrement(t *testing.T) {
|
||||
assert.Equal(t, 1, val)
|
||||
|
||||
// one matriochka increments matriochka counter
|
||||
router.Route(&meowlib.ToServerMessage{
|
||||
router.Route(context.Background(),&meowlib.ToServerMessage{
|
||||
MatriochkaMessage: &meowlib.Matriochka{Data: []byte("m")},
|
||||
})
|
||||
val, _ = router.Client.Get("statistics:messages:matriochka").Int()
|
||||
assert.Equal(t, 1, val)
|
||||
|
||||
// one invitation increments invitation counter
|
||||
router.Route(&meowlib.ToServerMessage{
|
||||
router.Route(context.Background(),&meowlib.ToServerMessage{
|
||||
Invitation: &meowlib.Invitation{
|
||||
Step: 1,
|
||||
Payload: []byte("i"),
|
||||
|
||||
Reference in New Issue
Block a user