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

Function RequestWithQueryStringDataTypes

test/execution_test.go:614–640  ·  view source on GitHub ↗
(t *testing.T, datatype string, argument string, value string)

Source from the content-addressed store, hash-verified

612}
613
614func RequestWithQueryStringDataTypes(t *testing.T, datatype string, argument string, value string) {
615 definition := `
616paths:
617 /ping:
618 parameters:
619 - name: filter
620 in: query
621 required: true
622 description: The filter
623 schema:
624 type: ` + datatype + `
625 get:
626 operationId: ping
627 summary: Simple ping
628`
629 context := NewContextBuilder().
630 WithResponse(http.StatusOK, "{}").
631 WithDefinition("myservice", definition).
632 Build()
633
634 result := RunCli([]string{"myservice", "ping", "--filter", argument}, context)
635
636 expected := `/ping?filter=` + value
637 if result.RequestUrl != expected {
638 t.Errorf("Invalid request url, expected: %v, got: %v", expected, result.RequestUrl)
639 }
640}
641
642func TestRequestWithHeaderDataTypes(t *testing.T) {
643 t.Run("String", func(t *testing.T) { RequestWithHeaderDataTypes(t, "string", "myvalue", "myvalue") })

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