Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Jul 2, 2024
1 parent 78f5c20 commit 1439e34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down

0 comments on commit 1439e34

Please sign in to comment.