(t *testing.T, itemsType string, arguments []string, pathValue string)
| 446 | } |
| 447 | |
| 448 | func MultipleArgumentsArray(t *testing.T, itemsType string, arguments []string, pathValue string) { |
| 449 | definition := ` |
| 450 | paths: |
| 451 | /ping/{ids}: |
| 452 | parameters: |
| 453 | - name: ids |
| 454 | in: path |
| 455 | required: true |
| 456 | description: The ids |
| 457 | schema: |
| 458 | type: array |
| 459 | items: |
| 460 | type: ` + itemsType + ` |
| 461 | get: |
| 462 | operationId: ping |
| 463 | summary: Simple ping |
| 464 | ` |
| 465 | context := NewContextBuilder(). |
| 466 | WithResponse(http.StatusOK, "{}"). |
| 467 | WithDefinition("myservice", definition). |
| 468 | Build() |
| 469 | |
| 470 | args := []string{"myservice", "ping"} |
| 471 | for _, arg := range arguments { |
| 472 | args = append(args, "--ids", arg) |
| 473 | } |
| 474 | result := RunCli(args, context) |
| 475 | |
| 476 | expected := "/ping/" + pathValue |
| 477 | if result.RequestUrl != expected { |
| 478 | t.Errorf("Invalid request url, expected: %v, got: %v", expected, result.RequestUrl) |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | func TestRequestWithHeaderParameterArray(t *testing.T) { |
| 483 | t.Run("StringArray", func(t *testing.T) { |
no test coverage detected