package instance import ( "context" "plugins/sdk/proto" "testing" "time" ) func TestLoad(t *testing.T) { load := []*PkgConf{ { Cmd: "pkg/zltx", Tag: "zltx", }, } if err := Load(load); err != nil { t.Errorf("Load() error = %v", err) return } srv := Get("zltx") if srv == nil { t.Errorf("Get() is nill") return } request := &proto.OrderRequest{ Config: &proto.Config{ AppId: "", AppKey: "", BaseUri: "", NotifyUrl: "", }, Order: &proto.OrderRequest_Order{ OrderNo: "zltx_" + time.Now().Format("20060102150405"), Account: "18666666666", Extra: nil, }, Product: &proto.OrderRequest_Product{ ProductNo: "106", Extra: []byte(`{}`), }, } result, err := srv.Order(context.Background(), request) if err != nil { t.Errorf("Order() error = %v", err) return } t.Logf("Order() result = %v", result) }