1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2025-09-19 01:30:23 +02:00
seaweedfs/weed/mq/kafka/gateway/test_server.go
2025-09-17 00:02:38 -07:00

23 lines
573 B
Go

package gateway
import (
"context"
"github.com/seaweedfs/seaweedfs/weed/mq/kafka/protocol"
)
// NewTestServerForUnitTests creates a server for unit testing without requiring SeaweedMQ masters
// This should ONLY be used for unit tests that don't need real SeaweedMQ functionality
func NewTestServerForUnitTests(opts Options) *Server {
ctx, cancel := context.WithCancel(context.Background())
// Create handler for unit tests
handler := protocol.NewHandlerForUnitTests()
return &Server{
opts: opts,
ctx: ctx,
cancel: cancel,
handler: handler,
}
}