(t *testing.T)
| 340 | } |
| 341 | |
| 342 | func (s) TestParseMsgSize(t *testing.T) { |
| 343 | testcases := []parseTestCase{ |
| 344 | { |
| 345 | scjs: `{ |
| 346 | "methodConfig": [ |
| 347 | { |
| 348 | "name": [ |
| 349 | { |
| 350 | "service": "foo", |
| 351 | "method": "Bar" |
| 352 | } |
| 353 | ], |
| 354 | "maxRequestMessageBytes": 1024, |
| 355 | "maxResponseMessageBytes": 2048 |
| 356 | } |
| 357 | ] |
| 358 | }`, |
| 359 | wantSC: &ServiceConfig{ |
| 360 | Methods: map[string]MethodConfig{ |
| 361 | "/foo/Bar": { |
| 362 | MaxReqSize: newInt(1024), |
| 363 | MaxRespSize: newInt(2048), |
| 364 | }, |
| 365 | }, |
| 366 | lbConfig: lbConfigFor(t, "", nil), |
| 367 | }, |
| 368 | }, |
| 369 | { |
| 370 | scjs: `{ |
| 371 | "methodConfig": [ |
| 372 | { |
| 373 | "name": [ |
| 374 | { |
| 375 | "service": "foo", |
| 376 | "method": "Bar" |
| 377 | } |
| 378 | ], |
| 379 | "maxRequestMessageBytes": "1024", |
| 380 | "maxResponseMessageBytes": "2048" |
| 381 | }, |
| 382 | { |
| 383 | "name": [ |
| 384 | { |
| 385 | "service": "foo", |
| 386 | "method": "Bar" |
| 387 | } |
| 388 | ], |
| 389 | "maxRequestMessageBytes": 1024, |
| 390 | "maxResponseMessageBytes": 2048 |
| 391 | } |
| 392 | ] |
| 393 | }`, |
| 394 | wantErr: true, |
| 395 | }, |
| 396 | } |
| 397 | |
| 398 | runParseTests(t, testcases) |
| 399 | } |
nothing calls this directly
no test coverage detected