test: fix unit tests

mock files regenerated with mockery v2.43.0
This commit is contained in:
Haruue 2024-05-11 15:07:25 +08:00
parent ba9b3cdebb
commit 6a34a9e7a0
No known key found for this signature in database
GPG key ID: F6083B28CBCBC148
7 changed files with 112 additions and 12 deletions

View file

@ -82,9 +82,13 @@ func (s *serverImpl) handleClient(conn quic.Connection) {
}
err := h3s.ServeQUICConn(conn)
// If the client is authenticated, we need to log the disconnect event
if handler.authenticated && s.config.EventLogger != nil {
s.config.TrafficLogger.LogOnlineStateChanged(handler.authID, false)
s.config.EventLogger.Disconnect(conn.RemoteAddr(), handler.authID, err)
if handler.authenticated {
if tl := s.config.TrafficLogger; tl != nil {
tl.LogOnlineStateChanged(handler.authID, false)
}
if el := s.config.EventLogger; el != nil {
el.Disconnect(conn.RemoteAddr(), handler.authID, err)
}
}
_ = conn.CloseWithError(closeErrCodeOK, "")
}
@ -154,9 +158,11 @@ func (h *h3sHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
})
w.WriteHeader(protocol.StatusAuthOK)
// Call event logger
if h.config.EventLogger != nil {
h.config.TrafficLogger.LogOnlineStateChanged(id, true)
h.config.EventLogger.Connect(h.conn.RemoteAddr(), id, actualTx)
if tl := h.config.TrafficLogger; tl != nil {
tl.LogOnlineStateChanged(id, true)
}
if el := h.config.EventLogger; el != nil {
el.Connect(h.conn.RemoteAddr(), id, actualTx)
}
// Initialize UDP session manager (if UDP is enabled)
// We use sync.Once to make sure that only one goroutine is started,