(t *testing.T)
| 143 | } |
| 144 | |
| 145 | func (s) TestParseLoadBalancer(t *testing.T) { |
| 146 | testcases := []parseTestCase{ |
| 147 | { |
| 148 | scjs: `{ |
| 149 | "loadBalancingPolicy": "round_robin", |
| 150 | "methodConfig": [ |
| 151 | { |
| 152 | "name": [ |
| 153 | { |
| 154 | "service": "foo", |
| 155 | "method": "Bar" |
| 156 | } |
| 157 | ], |
| 158 | "waitForReady": true |
| 159 | } |
| 160 | ] |
| 161 | }`, |
| 162 | wantSC: &ServiceConfig{ |
| 163 | Methods: map[string]MethodConfig{ |
| 164 | "/foo/Bar": { |
| 165 | WaitForReady: newBool(true), |
| 166 | }, |
| 167 | }, |
| 168 | lbConfig: lbConfigFor(t, "round_robin", nil), |
| 169 | }, |
| 170 | wantErr: false, |
| 171 | }, |
| 172 | { |
| 173 | scjs: `{ |
| 174 | "loadBalancingPolicy": 1, |
| 175 | "methodConfig": [ |
| 176 | { |
| 177 | "name": [ |
| 178 | { |
| 179 | "service": "foo", |
| 180 | "method": "Bar" |
| 181 | } |
| 182 | ], |
| 183 | "waitForReady": false |
| 184 | } |
| 185 | ] |
| 186 | }`, |
| 187 | wantErr: true, |
| 188 | }, |
| 189 | } |
| 190 | runParseTests(t, testcases) |
| 191 | } |
| 192 | |
| 193 | func (s) TestParseWaitForReady(t *testing.T) { |
| 194 | testcases := []parseTestCase{ |
nothing calls this directly
no test coverage detected