(t *testing.T)
| 398 | runParseTests(t, testcases) |
| 399 | } |
| 400 | func (s) TestParseDefaultMethodConfig(t *testing.T) { |
| 401 | dc := &ServiceConfig{ |
| 402 | Methods: map[string]MethodConfig{ |
| 403 | "": {WaitForReady: newBool(true)}, |
| 404 | }, |
| 405 | lbConfig: lbConfigFor(t, "", nil), |
| 406 | } |
| 407 | |
| 408 | runParseTests(t, []parseTestCase{ |
| 409 | { |
| 410 | scjs: `{ |
| 411 | "methodConfig": [{ |
| 412 | "name": [{}], |
| 413 | "waitForReady": true |
| 414 | }] |
| 415 | }`, |
| 416 | wantSC: dc, |
| 417 | }, |
| 418 | { |
| 419 | scjs: `{ |
| 420 | "methodConfig": [{ |
| 421 | "name": [{"service": null}], |
| 422 | "waitForReady": true |
| 423 | }] |
| 424 | }`, |
| 425 | wantSC: dc, |
| 426 | }, |
| 427 | { |
| 428 | scjs: `{ |
| 429 | "methodConfig": [{ |
| 430 | "name": [{"service": ""}], |
| 431 | "waitForReady": true |
| 432 | }] |
| 433 | }`, |
| 434 | wantSC: dc, |
| 435 | }, |
| 436 | { |
| 437 | scjs: `{ |
| 438 | "methodConfig": [{ |
| 439 | "name": [{"method": "Bar"}], |
| 440 | "waitForReady": true |
| 441 | }] |
| 442 | }`, |
| 443 | wantErr: true, |
| 444 | }, |
| 445 | { |
| 446 | scjs: `{ |
| 447 | "methodConfig": [{ |
| 448 | "name": [{"service": "", "method": "Bar"}], |
| 449 | "waitForReady": true |
| 450 | }] |
| 451 | }`, |
| 452 | wantErr: true, |
| 453 | }, |
| 454 | }) |
| 455 | } |
| 456 | |
| 457 | func (s) TestParseMethodConfigDuplicatedName(t *testing.T) { |
nothing calls this directly
no test coverage detected