v1_test.go 506 B

123456789101112131415161718192021222324
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package tests
  4. import (
  5. "context"
  6. v1 "adm-task/pb/v1"
  7. "testing"
  8. jsoniter "github.com/json-iterator/go"
  9. )
  10. var json = jsoniter.ConfigCompatibleWithStandardLibrary
  11. func Test_HelloV1(t *testing.T) {
  12. r, err := client.SayHelloV1(context.Background(), &v1.HelloRequest{Name: "world"})
  13. if err == nil {
  14. s, _ := json.MarshalToString(r)
  15. t.Log(s)
  16. } else {
  17. t.Error("failed to call: ", err)
  18. }
  19. }