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

Function TestProcessURLWithDirectUserURL

client/action_test.go:140–158  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

138}
139
140func TestProcessURLWithDirectUserURL(t *testing.T) {
141 ref := &global.ReferenceConfig{
142 InterfaceName: "com.example.Service",
143 Protocol: constant.TriProtocol,
144 URL: "tri://localhost:20000",
145 }
146 cfgURL := common.NewURLWithOptions(
147 common.WithPath(ref.InterfaceName),
148 common.WithParamsValue(constant.GroupKey, "test-group"),
149 )
150
151 urls, err := processURL(ref, nil, cfgURL)
152 require.NoError(t, err)
153 require.Len(t, urls, 1)
154 require.Equal(t, constant.TriProtocol, urls[0].Protocol)
155 require.Equal(t, "/"+ref.InterfaceName, urls[0].Path)
156 require.Equal(t, "test-group", urls[0].GetParam(constant.GroupKey, ""))
157 require.Equal(t, "true", urls[0].GetParam("peer", ""))
158}
159
160func TestProcessURLWithMultipleDirectUserURLs(t *testing.T) {
161 ref := &global.ReferenceConfig{

Callers

nothing calls this directly

Calls 7

NewURLWithOptionsFunction · 0.92
WithPathFunction · 0.92
WithParamsValueFunction · 0.92
processURLFunction · 0.85
LenMethod · 0.45
EqualMethod · 0.45
GetParamMethod · 0.45

Tested by

no test coverage detected