(t *testing.T)
| 838 | } |
| 839 | |
| 840 | func (s) TestDefaultServiceConfig(t *testing.T) { |
| 841 | const defaultSC = ` |
| 842 | { |
| 843 | "methodConfig": [ |
| 844 | { |
| 845 | "name": [ |
| 846 | { |
| 847 | "service": "foo", |
| 848 | "method": "bar" |
| 849 | } |
| 850 | ], |
| 851 | "waitForReady": true |
| 852 | } |
| 853 | ] |
| 854 | }` |
| 855 | tests := []struct { |
| 856 | name string |
| 857 | testF func(t *testing.T, r *manual.Resolver, addr, sc string) |
| 858 | sc string |
| 859 | }{ |
| 860 | { |
| 861 | name: "invalid-service-config", |
| 862 | testF: testInvalidDefaultServiceConfig, |
| 863 | sc: "", |
| 864 | }, |
| 865 | { |
| 866 | name: "resolver-service-config-disabled", |
| 867 | testF: testDefaultServiceConfigWhenResolverServiceConfigDisabled, |
| 868 | sc: defaultSC, |
| 869 | }, |
| 870 | { |
| 871 | name: "resolver-does-not-return-service-config", |
| 872 | testF: testDefaultServiceConfigWhenResolverDoesNotReturnServiceConfig, |
| 873 | sc: defaultSC, |
| 874 | }, |
| 875 | { |
| 876 | name: "resolver-returns-invalid-service-config", |
| 877 | testF: testDefaultServiceConfigWhenResolverReturnInvalidServiceConfig, |
| 878 | sc: defaultSC, |
| 879 | }, |
| 880 | } |
| 881 | |
| 882 | for _, test := range tests { |
| 883 | t.Run(test.name, func(t *testing.T) { |
| 884 | r := manual.NewBuilderWithScheme(test.name) |
| 885 | addr := r.Scheme() + ":///non.existent" |
| 886 | test.testF(t, r, addr, test.sc) |
| 887 | }) |
| 888 | } |
| 889 | } |
| 890 | |
| 891 | func verifyWaitForReadyEqualsTrue(cc *ClientConn) bool { |
| 892 | var i int |
nothing calls this directly
no test coverage detected