MCPcopy Create free account
hub / github.com/UiPath/uipathcli / RequestWithHeaderParameterArray

Function RequestWithHeaderParameterArray

test/execution_test.go:497–525  ·  view source on GitHub ↗
(t *testing.T, itemsType string, argument string, headerValue string)

Source from the content-addressed store, hash-verified

495}
496
497func RequestWithHeaderParameterArray(t *testing.T, itemsType string, argument string, headerValue string) {
498 definition := `
499paths:
500 /ping:
501 parameters:
502 - name: ids
503 in: header
504 required: true
505 description: The ids
506 schema:
507 type: array
508 items:
509 type: ` + itemsType + `
510 get:
511 operationId: ping
512 summary: Simple ping
513`
514 context := NewContextBuilder().
515 WithResponse(http.StatusOK, "{}").
516 WithDefinition("myservice", definition).
517 Build()
518
519 result := RunCli([]string{"myservice", "ping", "--ids", argument}, context)
520
521 header := result.RequestHeader["ids"]
522 if header != headerValue {
523 t.Errorf("Invalid header value, expected: %v, got: %v", headerValue, header)
524 }
525}
526
527func TestRequestWithQueryStringParameterArray(t *testing.T) {
528 t.Run("StringArray", func(t *testing.T) {

Callers 1

Calls 5

NewContextBuilderFunction · 0.85
RunCliFunction · 0.85
WithDefinitionMethod · 0.80
WithResponseMethod · 0.80
BuildMethod · 0.45

Tested by

no test coverage detected