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

Function TestNewRPCInvocation

protocol/invocation/rpcinvocation_test.go:86–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestNewRPCInvocation(t *testing.T) {
87 methodName := "testMethod"
88 arguments := []any{"arg1", 123, true}
89 attachments := map[string]any{
90 "key1": "value1",
91 "key2": "value2",
92 }
93
94 invocation := NewRPCInvocation(methodName, arguments, attachments)
95
96 assert.NotNil(t, invocation)
97 assert.Equal(t, methodName, invocation.MethodName())
98 assert.Equal(t, arguments, invocation.Arguments())
99 assert.Equal(t, attachments, invocation.Attachments())
100 assert.NotNil(t, invocation.Attributes())
101 assert.Empty(t, invocation.Attributes())
102}
103
104func TestNewRPCInvocationWithOptions(t *testing.T) {
105 methodName := "testMethod"

Callers

nothing calls this directly

Calls 6

MethodNameMethod · 0.95
ArgumentsMethod · 0.95
AttachmentsMethod · 0.95
AttributesMethod · 0.95
NewRPCInvocationFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected