added test
This commit is contained in:
parent
0d4e26aceb
commit
0b3b63295e
38
golang/server_test.go
Normal file
38
golang/server_test.go
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package server_grpc
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestRPC(t *testing.T) {
|
||||||
|
|
||||||
|
conn, err := grpc.Dial(":50006", grpc.WithInsecure())
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
t.Log(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
client := NewOverflowApiServerClient(conn)
|
||||||
|
|
||||||
|
si := &ServerInput{}
|
||||||
|
|
||||||
|
si.Target = "noauthProbe"
|
||||||
|
si.Method = "readAllByDomain"
|
||||||
|
|
||||||
|
sp := &ServerParam{}
|
||||||
|
sp.IsCollection = false
|
||||||
|
sp.Type = "com.loafle.overflow.module.domain.model.Domain"
|
||||||
|
sp.Data = "{\"id\":1}"
|
||||||
|
si.Params = append(si.Params, sp)
|
||||||
|
|
||||||
|
|
||||||
|
out, err := client.Exec(context.Background(), si)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Log(out)
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user