MCPcopy Create free account
hub / github.com/apache/dubbo-go / TestGetMethodParamIntValue

Function TestGetMethodParamIntValue

common/url_test.go:932–945  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

930}
931
932func TestGetMethodParamIntValue(t *testing.T) {
933 params := url.Values{}
934 params.Set("methods.GetValue.timeout", "100")
935
936 u := &URL{}
937 u.SetParams(params)
938
939 v := u.GetMethodParamIntValue("GetValue", "timeout", 0)
940 assert.Equal(t, 100, v)
941
942 // missing method param
943 v2 := u.GetMethodParamIntValue("OtherMethod", "timeout", 50)
944 assert.Equal(t, 50, v2)
945}
946
947func TestGetMethodParamInt64(t *testing.T) {
948 params := url.Values{}

Callers

nothing calls this directly

Calls 4

SetParamsMethod · 0.95
SetMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected