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

Function RequestWithQueryStringParameterArray

test/execution_test.go:542–570  ·  view source on GitHub ↗
(t *testing.T, itemsType string, argument string, queryStringValue string)

Source from the content-addressed store, hash-verified

540}
541
542func RequestWithQueryStringParameterArray(t *testing.T, itemsType string, argument string, queryStringValue string) {
543 definition := `
544paths:
545 /ping:
546 parameters:
547 - name: id
548 in: query
549 required: true
550 description: The id
551 schema:
552 type: array
553 items:
554 type: ` + itemsType + `
555 get:
556 operationId: ping
557 summary: Simple ping
558`
559 context := NewContextBuilder().
560 WithResponse(http.StatusOK, "{}").
561 WithDefinition("myservice", definition).
562 Build()
563
564 result := RunCli([]string{"myservice", "ping", "--id", argument}, context)
565
566 expected := "/ping?" + queryStringValue
567 if result.RequestUrl != expected {
568 t.Errorf("Invalid request url, expected: %v, got: %v", expected, result.RequestUrl)
569 }
570}
571
572func TestRequestWithPathParameterDataTypes(t *testing.T) {
573 t.Run("String", func(t *testing.T) { RequestWithPathParameterDataType(t, "string", "myvalue", "myvalue") })

Calls 5

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

Tested by

no test coverage detected