mirror of
https://github.com/chrislusf/seaweedfs
synced 2025-09-19 01:30:23 +02:00
23 lines
573 B
Go
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,
|
|
}
|
|
}
|