Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ftr: [refer dubbo 2.7.6] attachment type from map[string]stiring to map[string]interface{} #713

Merged
merged 18 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cluster/cluster_impl/zone_aware_cluster_invoker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestZoneWareInvokerWithPreferredSuccess(t *testing.T) {
//defer ctrl.Finish()

mockResult := &protocol.RPCResult{
Attrs: map[string]string{constant.PREFERRED_KEY: "true"},
Attrs: map[string]interface{}{constant.PREFERRED_KEY: "true"},
Rest: rest{tried: 0, success: true}}

var invokers []protocol.Invoker
Expand Down Expand Up @@ -99,15 +99,15 @@ func TestZoneWareInvokerWithWeightSuccess(t *testing.T) {
invoker.EXPECT().Invoke(gomock.Any()).DoAndReturn(
func(invocation protocol.Invocation) protocol.Result {
return &protocol.RPCResult{
Attrs: map[string]string{constant.WEIGHT_KEY: w1},
Attrs: map[string]interface{}{constant.WEIGHT_KEY: w1},
Rest: rest{tried: 0, success: true}}
}).MaxTimes(100)
} else {
url.SetParam(constant.REGISTRY_KEY+"."+constant.WEIGHT_KEY, w2)
invoker.EXPECT().Invoke(gomock.Any()).DoAndReturn(
func(invocation protocol.Invocation) protocol.Result {
return &protocol.RPCResult{
Attrs: map[string]string{constant.WEIGHT_KEY: w2},
Attrs: map[string]interface{}{constant.WEIGHT_KEY: w2},
Rest: rest{tried: 0, success: true}}
}).MaxTimes(100)
}
Expand Down Expand Up @@ -154,7 +154,7 @@ func TestZoneWareInvokerWithZoneSuccess(t *testing.T) {
invoker.EXPECT().Invoke(gomock.Any()).DoAndReturn(
func(invocation protocol.Invocation) protocol.Result {
return &protocol.RPCResult{
Attrs: map[string]string{constant.ZONE_KEY: zoneValue},
Attrs: map[string]interface{}{constant.ZONE_KEY: zoneValue},
Rest: rest{tried: 0, success: true}}
})
invokers = append(invokers, invoker)
Expand Down
6 changes: 4 additions & 2 deletions cluster/router/tag/tag_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ func isAnyHost(addr string) bool {
func findTag(invocation protocol.Invocation, consumerUrl *common.URL) string {
tag, ok := invocation.Attachments()[constant.Tagkey]
if !ok {
tag = consumerUrl.GetParam(constant.Tagkey, "")
return consumerUrl.GetParam(constant.Tagkey, "")
} else if v, t := tag.(string); t {
return v
}
return tag
return ""
}
4 changes: 4 additions & 0 deletions common/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ func (p *Proxy) Implement(v common.RPCService) {
for k, value := range m {
inv.SetAttachments(k, value)
}
} else if m2, ok2 := atm.(map[string]interface{}); ok2 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'd better leave some comments here so that others can understand the context better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, the comment should be aligned with the else branch in the same line or under the else branch if it is too long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

for k, value := range m2 {
inv.SetAttachments(k, value)
}
}

result := p.invoke.Invoke(invCtx, inv)
Expand Down
34 changes: 34 additions & 0 deletions common/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package proxy

import (
"context"
hessian "github.com/apache/dubbo-go-hessian2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG. move it to the second import block, pls.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"github.com/apache/dubbo-go/protocol/invocation"
"reflect"
"testing"
)
Expand All @@ -40,6 +42,7 @@ type TestService struct {
MethodThree func(int, bool) (interface{}, error)
MethodFour func(int, bool) (*interface{}, error) `dubbo:"methodFour"`
MethodFive func() error
MethodSix func(context.Context, string) (interface{}, error)
Echo func(interface{}, *interface{}) error
}

Expand Down Expand Up @@ -120,3 +123,34 @@ func TestProxyImplement(t *testing.T) {
assert.Nil(t, s3.MethodOne)

}

func TestProxyImplementForContext(t *testing.T) {
invoker := &TestProxyInvoker{
BaseInvoker: *protocol.NewBaseInvoker(common.URL{}),
}
p := NewProxy(invoker, nil, map[string]string{constant.ASYNC_KEY: "false"})
s := &TestService{}
p.Implement(s)
attahments1 := make(map[string]interface{}, 4)
attahments1["k1"] = "v1"
attahments1["k2"] = "v2"
context := context.WithValue(context.Background(), constant.AttachmentKey, attahments1)
r, err := p.Get().(*TestService).MethodSix(context, "xxx")
v1 := r.(map[string]interface{})
assert.NoError(t, err)
assert.Equal(t, v1["TestProxyInvoker"], "TestProxyInvokerValue")
}

type TestProxyInvoker struct {
protocol.BaseInvoker
}

func (bi *TestProxyInvoker) Invoke(context context.Context, inv protocol.Invocation) protocol.Result {
rpcInv := inv.(*invocation.RPCInvocation)
mapV := inv.Attachments()
mapV["TestProxyInvoker"] = "TestProxyInvokerValue"
hessian.ReflectResponse(mapV, rpcInv.Reply())
return &protocol.RPCResult{
Rest: inv.Arguments(),
}
}
28 changes: 21 additions & 7 deletions filter/filter_impl/access_log_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,27 @@ func (ef *AccessLogFilter) logIntoChannel(accessLogData AccessLogData) {
func (ef *AccessLogFilter) buildAccessLogData(_ protocol.Invoker, invocation protocol.Invocation) map[string]string {
dataMap := make(map[string]string, 16)
attachments := invocation.Attachments()
dataMap[constant.INTERFACE_KEY] = attachments[constant.INTERFACE_KEY]
dataMap[constant.METHOD_KEY] = invocation.MethodName()
dataMap[constant.VERSION_KEY] = attachments[constant.VERSION_KEY]
dataMap[constant.GROUP_KEY] = attachments[constant.GROUP_KEY]
dataMap[constant.TIMESTAMP_KEY] = time.Now().Format(MessageDateLayout)
dataMap[constant.LOCAL_ADDR], _ = attachments[constant.LOCAL_ADDR]
dataMap[constant.REMOTE_ADDR], _ = attachments[constant.REMOTE_ADDR]
if v, ok := attachments[constant.INTERFACE_KEY]; ok && v != nil {
dataMap[constant.INTERFACE_KEY] = v.(string)
}
if v, ok := attachments[constant.METHOD_KEY]; ok && v != nil {
dataMap[constant.METHOD_KEY] = v.(string)
}
if v, ok := attachments[constant.VERSION_KEY]; ok && v != nil {
dataMap[constant.VERSION_KEY] = v.(string)
}
if v, ok := attachments[constant.GROUP_KEY]; ok && v != nil {
dataMap[constant.GROUP_KEY] = v.(string)
}
if v, ok := attachments[constant.TIMESTAMP_KEY]; ok && v != nil {
dataMap[constant.TIMESTAMP_KEY] = v.(string)
}
if v, ok := attachments[constant.LOCAL_ADDR]; ok && v != nil {
dataMap[constant.LOCAL_ADDR] = v.(string)
}
if v, ok := attachments[constant.REMOTE_ADDR]; ok && v != nil {
dataMap[constant.REMOTE_ADDR] = v.(string)
}

if len(invocation.Arguments()) > 0 {
builder := strings.Builder{}
Expand Down
4 changes: 2 additions & 2 deletions filter/filter_impl/access_log_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestAccessLogFilter_Invoke_Not_Config(t *testing.T) {
"service.filter=echo%2Ctoken%2Caccesslog&timestamp=1569153406&token=934804bf-b007-4174-94eb-96e3e1d60cc7&version=&warmup=100")
invoker := protocol.NewBaseInvoker(url)

attach := make(map[string]string, 10)
attach := make(map[string]interface{}, 10)
inv := invocation.NewRPCInvocation("MethodName", []interface{}{"OK", "Hello"}, attach)

accessLogFilter := GetAccessLogFilter()
Expand All @@ -64,7 +64,7 @@ func TestAccessLogFilterInvokeDefaultConfig(t *testing.T) {
"service.filter=echo%2Ctoken%2Caccesslog&timestamp=1569153406&token=934804bf-b007-4174-94eb-96e3e1d60cc7&version=&warmup=100")
invoker := protocol.NewBaseInvoker(url)

attach := make(map[string]string, 10)
attach := make(map[string]interface{}, 10)
attach[constant.VERSION_KEY] = "1.0"
attach[constant.GROUP_KEY] = "MyGroup"
inv := invocation.NewRPCInvocation("MethodName", []interface{}{"OK", "Hello"}, attach)
Expand Down
4 changes: 2 additions & 2 deletions filter/filter_impl/active_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
)

func TestActiveFilterInvoke(t *testing.T) {
invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, make(map[string]string, 0))
invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, make(map[string]interface{}, 0))
url, _ := common.NewURL("dubbo://192.168.10.10:20000/com.ikurento.user.UserProvider")
filter := ActiveFilter{}
ctrl := gomock.NewController(t)
Expand All @@ -53,7 +53,7 @@ func TestActiveFilterInvoke(t *testing.T) {
func TestActiveFilterOnResponse(t *testing.T) {
c := protocol.CurrentTimeMillis()
elapsed := 100
invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, map[string]string{
invoc := invocation.NewRPCInvocation("test", []interface{}{"OK"}, map[string]interface{}{
dubboInvokeStartTime: strconv.FormatInt(c-int64(elapsed), 10),
})
url, _ := common.NewURL("dubbo://192.168.10.10:20000/com.ikurento.user.UserProvider")
Expand Down
6 changes: 3 additions & 3 deletions filter/filter_impl/auth/default_authenticator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestDefaultAuthenticator_Authenticate(t *testing.T) {

var authenticator = &DefaultAuthenticator{}

invcation := invocation.NewRPCInvocation("test", parmas, map[string]string{
invcation := invocation.NewRPCInvocation("test", parmas, map[string]interface{}{
constant.REQUEST_SIGNATURE_KEY: signature,
constant.CONSUMER: "test",
constant.REQUEST_TIMESTAMP_KEY: requestTime,
Expand All @@ -61,7 +61,7 @@ func TestDefaultAuthenticator_Authenticate(t *testing.T) {
err := authenticator.Authenticate(invcation, &testurl)
assert.Nil(t, err)
// modify the params
invcation = invocation.NewRPCInvocation("test", parmas[:1], map[string]string{
invcation = invocation.NewRPCInvocation("test", parmas[:1], map[string]interface{}{
constant.REQUEST_SIGNATURE_KEY: signature,
constant.CONSUMER: "test",
constant.REQUEST_TIMESTAMP_KEY: requestTime,
Expand Down Expand Up @@ -119,7 +119,7 @@ func Test_getAccessKeyPairFailed(t *testing.T) {
func Test_getSignatureWithinParams(t *testing.T) {
testurl, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider?interface=com.ikurento.user.UserProvider&group=gg&version=2.6.0")
testurl.SetParam(constant.PARAMTER_SIGNATURE_ENABLE_KEY, "true")
inv := invocation.NewRPCInvocation("test", []interface{}{"OK"}, map[string]string{
inv := invocation.NewRPCInvocation("test", []interface{}{"OK"}, map[string]interface{}{
"": "",
})
secret := "dubbo"
Expand Down
2 changes: 1 addition & 1 deletion filter/filter_impl/auth/provider_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestProviderAuthFilter_Invoke(t *testing.T) {
requestTime := strconv.Itoa(int(time.Now().Unix() * 1000))
signature, _ := getSignature(&url, inv, secret, requestTime)

inv = invocation.NewRPCInvocation("test", []interface{}{"OK"}, map[string]string{
inv = invocation.NewRPCInvocation("test", []interface{}{"OK"}, map[string]interface{}{
constant.REQUEST_SIGNATURE_KEY: signature,
constant.CONSUMER: "test",
constant.REQUEST_TIMESTAMP_KEY: requestTime,
Expand Down
6 changes: 3 additions & 3 deletions filter/filter_impl/execute_limit_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (

func TestExecuteLimitFilterInvokeIgnored(t *testing.T) {
methodName := "hello"
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0))

invokeUrl := common.NewURLWithOptions(
common.WithParams(url.Values{}),
Expand All @@ -51,7 +51,7 @@ func TestExecuteLimitFilterInvokeIgnored(t *testing.T) {

func TestExecuteLimitFilterInvokeConfigureError(t *testing.T) {
methodName := "hello1"
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0))

invokeUrl := common.NewURLWithOptions(
common.WithParams(url.Values{}),
Expand All @@ -68,7 +68,7 @@ func TestExecuteLimitFilterInvokeConfigureError(t *testing.T) {

func TestExecuteLimitFilterInvoke(t *testing.T) {
methodName := "hello1"
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0))

invokeUrl := common.NewURLWithOptions(
common.WithParams(url.Values{}),
Expand Down
2 changes: 1 addition & 1 deletion filter/filter_impl/graceful_shutdown_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
)

func TestGenericFilterInvoke(t *testing.T) {
invoc := invocation.NewRPCInvocation("GetUser", []interface{}{"OK"}, make(map[string]string, 0))
invoc := invocation.NewRPCInvocation("GetUser", []interface{}{"OK"}, make(map[string]interface{}, 0))

invokeUrl := common.NewURLWithOptions(
common.WithParams(url.Values{}))
Expand Down
2 changes: 1 addition & 1 deletion filter/filter_impl/metrics_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestMetricsFilterInvoke(t *testing.T) {
"service.filter=echo%2Ctoken%2Caccesslog&timestamp=1569153406&token=934804bf-b007-4174-94eb-96e3e1d60cc7&version=&warmup=100")
invoker := protocol.NewBaseInvoker(url)

attach := make(map[string]string, 10)
attach := make(map[string]interface{}, 10)
inv := invocation.NewRPCInvocation("MethodName", []interface{}{"OK", "Hello"}, attach)

ctx := context.Background()
Expand Down
7 changes: 4 additions & 3 deletions filter/filter_impl/seata_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ func (iv *testMockSeataInvoker) Invoke(ctx context.Context, _ protocol.Invocatio

func TestSeataFilter_Invoke(t *testing.T) {
filter := getSeataFilter()
result := filter.Invoke(context.Background(), &testMockSeataInvoker{}, invocation.NewRPCInvocation("$echo", []interface{}{"OK"}, map[string]string{
SEATA_XID: "10.30.21.227:8091:2000047792",
}))
result := filter.Invoke(context.Background(), &testMockSeataInvoker{}, invocation.NewRPCInvocation("$echo",
[]interface{}{"OK"}, map[string]interface{}{
SEATA_XID: "10.30.21.227:8091:2000047792",
}))
assert.Equal(t, "10.30.21.227:8091:2000047792", result.Result())
}
2 changes: 1 addition & 1 deletion filter/filter_impl/token_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (tf *TokenFilter) Invoke(ctx context.Context, invoker protocol.Invoker, inv
if len(invokerTkn) > 0 {
attachs := invocation.Attachments()
remoteTkn, exist := attachs[constant.TOKEN_KEY]
if exist && strings.EqualFold(invokerTkn, remoteTkn) {
if exist && remoteTkn != nil && strings.EqualFold(invokerTkn, remoteTkn.(string)) {
return invoker.Invoke(ctx, invocation)
}
return &protocol.RPCResult{Err: perrors.Errorf("Invalid token! Forbid invoke remote service %v method %s ",
Expand Down
8 changes: 4 additions & 4 deletions filter/filter_impl/token_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestTokenFilterInvoke(t *testing.T) {
url := common.NewURLWithOptions(
common.WithParams(url.Values{}),
common.WithParamsValue(constant.TOKEN_KEY, "ori_key"))
attch := make(map[string]string, 0)
attch := make(map[string]interface{}, 0)
attch[constant.TOKEN_KEY] = "ori_key"
result := filter.Invoke(context.Background(),
protocol.NewBaseInvoker(*url),
Expand All @@ -54,7 +54,7 @@ func TestTokenFilterInvokeEmptyToken(t *testing.T) {
filter := GetTokenFilter()

testUrl := common.URL{}
attch := make(map[string]string, 0)
attch := make(map[string]interface{}, 0)
attch[constant.TOKEN_KEY] = "ori_key"
result := filter.Invoke(context.Background(), protocol.NewBaseInvoker(testUrl), invocation.NewRPCInvocation("MethodName", []interface{}{"OK"}, attch))
assert.Nil(t, result.Error())
Expand All @@ -67,7 +67,7 @@ func TestTokenFilterInvokeEmptyAttach(t *testing.T) {
testUrl := common.NewURLWithOptions(
common.WithParams(url.Values{}),
common.WithParamsValue(constant.TOKEN_KEY, "ori_key"))
attch := make(map[string]string, 0)
attch := make(map[string]interface{}, 0)
result := filter.Invoke(context.Background(), protocol.NewBaseInvoker(*testUrl), invocation.NewRPCInvocation("MethodName", []interface{}{"OK"}, attch))
assert.NotNil(t, result.Error())
}
Expand All @@ -78,7 +78,7 @@ func TestTokenFilterInvokeNotEqual(t *testing.T) {
testUrl := common.NewURLWithOptions(
common.WithParams(url.Values{}),
common.WithParamsValue(constant.TOKEN_KEY, "ori_key"))
attch := make(map[string]string, 0)
attch := make(map[string]interface{}, 0)
attch[constant.TOKEN_KEY] = "err_key"
result := filter.Invoke(context.Background(),
protocol.NewBaseInvoker(*testUrl), invocation.NewRPCInvocation("MethodName", []interface{}{"OK"}, attch))
Expand Down
8 changes: 4 additions & 4 deletions filter/filter_impl/tps/tps_limiter_method_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (

func TestMethodServiceTpsLimiterImplIsAllowableOnlyServiceLevel(t *testing.T) {
methodName := "hello"
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0))

ctrl := gomock.NewController(t)
defer ctrl.Finish()
Expand All @@ -63,7 +63,7 @@ func TestMethodServiceTpsLimiterImplIsAllowableOnlyServiceLevel(t *testing.T) {

func TestMethodServiceTpsLimiterImplIsAllowableNoConfig(t *testing.T) {
methodName := "hello1"
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0))
// ctrl := gomock.NewController(t)
// defer ctrl.Finish()

Expand All @@ -80,7 +80,7 @@ func TestMethodServiceTpsLimiterImplIsAllowableNoConfig(t *testing.T) {
func TestMethodServiceTpsLimiterImplIsAllowableMethodLevelOverride(t *testing.T) {
methodName := "hello2"
methodConfigPrefix := "methods." + methodName + "."
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0))
ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand Down Expand Up @@ -113,7 +113,7 @@ func TestMethodServiceTpsLimiterImplIsAllowableMethodLevelOverride(t *testing.T)
func TestMethodServiceTpsLimiterImplIsAllowableBothMethodAndService(t *testing.T) {
methodName := "hello3"
methodConfigPrefix := "methods." + methodName + "."
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]string, 0))
invoc := invocation.NewRPCInvocation(methodName, []interface{}{"OK"}, make(map[string]interface{}, 0))
ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand Down
6 changes: 3 additions & 3 deletions filter/filter_impl/tps_limit_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestTpsLimitFilterInvokeWithNoTpsLimiter(t *testing.T) {
invokeUrl := common.NewURLWithOptions(
common.WithParams(url.Values{}),
common.WithParamsValue(constant.TPS_LIMITER_KEY, ""))
attch := make(map[string]string, 0)
attch := make(map[string]interface{}, 0)

result := tpsFilter.Invoke(context.Background(),
protocol.NewBaseInvoker(*invokeUrl),
Expand All @@ -68,7 +68,7 @@ func TestGenericFilterInvokeWithDefaultTpsLimiter(t *testing.T) {
invokeUrl := common.NewURLWithOptions(
common.WithParams(url.Values{}),
common.WithParamsValue(constant.TPS_LIMITER_KEY, constant.DEFAULT_KEY))
attch := make(map[string]string, 0)
attch := make(map[string]interface{}, 0)

result := tpsFilter.Invoke(context.Background(),
protocol.NewBaseInvoker(*invokeUrl),
Expand Down Expand Up @@ -99,7 +99,7 @@ func TestGenericFilterInvokeWithDefaultTpsLimiterNotAllow(t *testing.T) {
invokeUrl := common.NewURLWithOptions(
common.WithParams(url.Values{}),
common.WithParamsValue(constant.TPS_LIMITER_KEY, constant.DEFAULT_KEY))
attch := make(map[string]string, 0)
attch := make(map[string]interface{}, 0)

result := tpsFilter.Invoke(context.Background(),
protocol.NewBaseInvoker(*invokeUrl), invocation.NewRPCInvocation("MethodName", []interface{}{"OK"}, attch))
Expand Down
2 changes: 1 addition & 1 deletion filter/filter_impl/tracing_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestTracingFilterInvoke(t *testing.T) {
"service.filter=echo%2Ctoken%2Caccesslog&timestamp=1569153406&token=934804bf-b007-4174-94eb-96e3e1d60cc7&version=&warmup=100")
invoker := protocol.NewBaseInvoker(url)

attach := make(map[string]string, 10)
attach := make(map[string]interface{}, 10)
inv := invocation.NewRPCInvocation("MethodName", []interface{}{"OK", "Hello"}, attach)
ctx := context.Background()
tf := newTracingFilter()
Expand Down
Loading