test: AuthManager close cleans up

This commit is contained in:
Jay
2026-06-03 16:34:59 -04:00
parent 783171e6ef
commit f8b45ae068
+15 -3
View File
@@ -182,8 +182,20 @@ func TestAuthManager(t *testing.T) {
})
t.Run("close cleans up", func(t *testing.T) {
// m.Close()
// feed another AUTH
// Never: callback invoked after close
p, envoy := newMockEnvoy(t)
called := false
callback := func(challenge string) ([]byte, error) {
called = true
return []byte(`{"kind":22242}`), nil
}
m := NewAuthManager(envoy, callback)
p.connect()
m.Close()
p.receive([]byte(envelope.EncloseAuthChallenge("abc")))
Never(t, func() bool { return called }, "callback should not fire after Close")
})
}