MCPcopy
hub / github.com/mochi-mqtt/server / TestHooksOnSubscribe

Function TestHooksOnSubscribe

hooks_test.go:291–303  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

289}
290
291func TestHooksOnSubscribe(t *testing.T) {
292 h := new(Hooks)
293 err := h.Add(new(modifiedHookBase), nil)
294 require.NoError(t, err)
295
296 pki := packets.Packet{
297 Filters: packets.Subscriptions{
298 {Filter: "a/b/c", Qos: 1},
299 },
300 }
301 pk := h.OnSubscribe(new(Client), pki)
302 require.EqualValues(t, pk, pki)
303}
304
305func TestHooksOnSelectSubscribers(t *testing.T) {
306 h := new(Hooks)

Callers

nothing calls this directly

Calls 2

OnSubscribeMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected