(t *testing.T)
| 127 | } |
| 128 | |
| 129 | func TestProxyImplementForContext(t *testing.T) { |
| 130 | invoker := &TestProxyInvoker{ |
| 131 | BaseInvoker: *base.NewBaseInvoker(&common.URL{}), |
| 132 | } |
| 133 | p := NewProxy(invoker, nil, map[string]string{constant.AsyncKey: "false"}) |
| 134 | s := &TestService{} |
| 135 | p.Implement(s) |
| 136 | attachments1 := make(map[string]any, 4) |
| 137 | attachments1["k1"] = "v1" |
| 138 | attachments1["k2"] = "v2" |
| 139 | context := context.WithValue(context.Background(), constant.AttachmentKey, attachments1) |
| 140 | r, err := p.Get().(*TestService).MethodSix(context, "xxx") |
| 141 | v1 := r.(map[string]any) |
| 142 | require.NoError(t, err) |
| 143 | assert.Equal(t, "TestProxyInvokerValue", v1["TestProxyInvoker"]) |
| 144 | } |
| 145 | |
| 146 | type TestProxyInvoker struct { |
| 147 | base.BaseInvoker |
nothing calls this directly
no test coverage detected