handler_test.go 569 B

12345678910111213141516171819202122
  1. package handler
  2. import (
  3. "GtDataStore/app/cmd/events/internal/config"
  4. "GtDataStore/app/cmd/events/internal/svc"
  5. "flag"
  6. "github.com/zeromicro/go-zero/core/conf"
  7. "metawant.greentech.com.cn/gaoyagang/gt-common/envitem"
  8. "testing"
  9. )
  10. func TestEventHandler_Start(t *testing.T) {
  11. var c config.Config
  12. var configFile = flag.String("f", "../../../etc/events.test.yaml", "the config file")
  13. conf.MustLoad(*configFile, &c)
  14. svcCtx := svc.NewServiceContext(c)
  15. envitem.SetOptions(envitem.Options{GtServerIp: c.GtServerIp})
  16. eh, _ := NewEventHandler(svcCtx)
  17. eh.Start()
  18. }