forked from p93542168/wheat-cache
24 lines
412 B
Go
24 lines
412 B
Go
package middle
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitee.com/timedb/wheatCache/pkg/event"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func Test_middleware_driver(t *testing.T) {
|
|
middleware := NewMiddleWare()
|
|
require.Equal(t, middleware.plugins["logcontext"][0].Name(), "logMiddle")
|
|
}
|
|
|
|
func TestWorker(t *testing.T) {
|
|
|
|
event := event.NewEvent("logcontext")
|
|
|
|
m := NewMiddleWare()
|
|
m.eventDriver.Put(event)
|
|
|
|
m.startWork()
|
|
}
|