You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/08/18 04:17:20 UTC

[dubbo-go] branch 3.0 updated: Change the key of a mock EchoFilter (#1381)

This is an automated email from the ASF dual-hosted git repository.

alexstocks pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new f8f38b5  Change the key of a mock EchoFilter (#1381)
f8f38b5 is described below

commit f8f38b5afc309380845114d4f643fc02e8cab997
Author: alchemy-lee <27...@qq.com>
AuthorDate: Wed Aug 18 12:17:14 2021 +0800

    Change the key of a mock EchoFilter (#1381)
    
    * build(deps): bump actions/cache from v2.1.4 to v2.1.5
    
    Bumps [actions/cache](https://github.com/actions/cache) from v2.1.4 to v2.1.5.
    - [Release notes](https://github.com/actions/cache/releases)
    - [Commits](https://github.com/actions/cache/compare/v2.1.4...1a9e2138d905efd099035b49d8b7a3888c653ca8)
    
    Signed-off-by: dependabot[bot] <su...@github.com>
    
    * improve etcd version and change create to put (#1203)
    
    * change the mock filter key
    
    Co-authored-by: dependabot[bot] <49...@users.noreply.github.com>
    Co-authored-by: Xin.Zh <dr...@foxmail.com>
    Co-authored-by: AlexStocks <al...@foxmail.com>
    Co-authored-by: randy <zt...@gmail.com>
---
 protocol/protocolwrapper/protocol_filter_wrapper_test.go | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/protocol/protocolwrapper/protocol_filter_wrapper_test.go b/protocol/protocolwrapper/protocol_filter_wrapper_test.go
index 842531f..2400058 100644
--- a/protocol/protocolwrapper/protocol_filter_wrapper_test.go
+++ b/protocol/protocolwrapper/protocol_filter_wrapper_test.go
@@ -36,13 +36,15 @@ import (
 	"dubbo.apache.org/dubbo-go/v3/protocol"
 )
 
+const mockFilterKey = "mockEcho"
+
 func TestProtocolFilterWrapperExport(t *testing.T) {
 	filtProto := extension.GetProtocol(FILTER)
 	filtProto.(*ProtocolFilterWrapper).protocol = &protocol.BaseProtocol{}
 
 	u := common.NewURLWithOptions(
 		common.WithParams(url.Values{}),
-		common.WithParamsValue(constant.SERVICE_FILTER_KEY, "echo "))
+		common.WithParamsValue(constant.SERVICE_FILTER_KEY, mockFilterKey))
 	exporter := filtProto.Export(protocol.NewBaseInvoker(u))
 	_, ok := exporter.GetInvoker().(*FilterInvoker)
 	assert.True(t, ok)
@@ -54,15 +56,15 @@ func TestProtocolFilterWrapperRefer(t *testing.T) {
 
 	u := common.NewURLWithOptions(
 		common.WithParams(url.Values{}),
-		common.WithParamsValue(constant.REFERENCE_FILTER_KEY, " echo"))
+		common.WithParamsValue(constant.REFERENCE_FILTER_KEY, mockFilterKey))
 	invoker := filtProto.Refer(u)
 	_, ok := invoker.(*FilterInvoker)
 	assert.True(t, ok)
 }
 
-// the same as echo filter, for test
+// The initialization of mockEchoFilter, for test
 func init() {
-	extension.SetFilter("echo", newFilter)
+	extension.SetFilter(mockFilterKey, newFilter)
 }
 
 type mockEchoFilter struct{}