(t *testing.T)
| 535 | } |
| 536 | |
| 537 | func (s) TestMethodConfigDefaultService(t *testing.T) { |
| 538 | addr := "passthrough:///non.existent" |
| 539 | cc, err := NewClient(addr, WithTransportCredentials(insecure.NewCredentials()), WithDefaultServiceConfig(`{ |
| 540 | "methodConfig": [{ |
| 541 | "name": [ |
| 542 | { |
| 543 | "service": "" |
| 544 | } |
| 545 | ], |
| 546 | "waitForReady": true |
| 547 | }] |
| 548 | }`)) |
| 549 | if err != nil { |
| 550 | t.Fatalf("grpc.NewClient(%s) failed: %v, want: nil", addr, err) |
| 551 | } |
| 552 | cc.Connect() |
| 553 | defer cc.Close() |
| 554 | |
| 555 | m := cc.GetMethodConfig("/foo/Bar") |
| 556 | if m.WaitForReady == nil { |
| 557 | t.Fatalf("want: method (%q) config to fallback to the default service", "/foo/Bar") |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | func (s) TestClientConnCanonicalTarget(t *testing.T) { |
| 562 | tests := []struct { |
nothing calls this directly
no test coverage detected