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

Function TestProcessURLWithMultipleDirectUserURLs

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

Source from the content-addressed store, hash-verified

158}
159
160func TestProcessURLWithMultipleDirectUserURLs(t *testing.T) {
161 ref := &global.ReferenceConfig{
162 InterfaceName: "com.example.Service",
163 Protocol: constant.TriProtocol,
164 URL: "tri://localhost:20000;tri://localhost:20001",
165 }
166 cfgURL := common.NewURLWithOptions(common.WithPath(ref.InterfaceName))
167
168 urls, err := processURL(ref, nil, cfgURL)
169 require.NoError(t, err)
170 require.Len(t, urls, 2)
171 require.Equal(t, constant.TriProtocol, urls[0].Protocol)
172 require.Equal(t, "true", urls[0].GetParam("peer", ""))
173 require.Equal(t, constant.TriProtocol, urls[1].Protocol)
174 require.Equal(t, "true", urls[1].GetParam("peer", ""))
175}
176
177func TestProcessURLRejectsInvalidUserURL(t *testing.T) {
178 ref := &global.ReferenceConfig{

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected