From 1439e342191f90490bd84f2ba873d4197182dc41 Mon Sep 17 00:00:00 2001 From: FZambia Date: Tue, 2 Jul 2024 22:07:09 +0300 Subject: [PATCH] fix tests --- node.go | 4 ---- node_test.go | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/node.go b/node.go index df5b5e73..8dc63af1 100644 --- a/node.go +++ b/node.go @@ -1617,10 +1617,6 @@ func (n *Node) OnCacheEmpty(h CacheEmptyHandler) { n.clientEvents.cacheEmptyHandler = h } -type brokerEventHandler struct { - node *Node -} - // HandlePublication coming from Broker. func (n *Node) HandlePublication(ch string, pub *Publication, sp StreamPosition, delta bool, prevPub *Publication) error { if pub == nil { diff --git a/node_test.go b/node_test.go index 3c5f49d0..98daf6f6 100644 --- a/node_test.go +++ b/node_test.go @@ -1175,15 +1175,14 @@ func TestSingleFlightPresence(t *testing.T) { func TestBrokerEventHandler_PanicsOnNil(t *testing.T) { node := defaultNodeNoHandlers() defer func() { _ = node.Shutdown(context.Background()) }() - handler := &brokerEventHandler{node: node} require.Panics(t, func() { - _ = handler.HandlePublication("test", nil, StreamPosition{}, false, nil) + _ = node.HandlePublication("test", nil, StreamPosition{}, false, nil) }) require.Panics(t, func() { - _ = handler.HandleJoin("test", nil) + _ = node.HandleJoin("test", nil) }) require.Panics(t, func() { - _ = handler.HandleLeave("test", nil) + _ = node.HandleLeave("test", nil) }) }