marsevilspirit commented on code in PR #3134:
URL: https://github.com/apache/dubbo-go/pull/3134#discussion_r2639907328
##########
config_center/parser/configuration_parser_test.go:
##########
@@ -87,3 +121,19 @@ configs:
assert.Equal(t, "override", urls[0].Protocol)
assert.Equal(t, "0.0.0.0", urls[0].Location)
}
+
+func TestGetParamString_ErrorWhenNoParams(t *testing.T) {
Review Comment:
meaningless code.
##########
config_center/zookeeper/factory_test.go:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package zookeeper
+
+import (
+ "testing"
+)
+
+import (
+ "dubbo.apache.org/dubbo-go/v3/common/extension"
+)
+
+func TestFactoryRegistered(t *testing.T) {
Review Comment:
Meaningless code.
##########
config_center/nacos/factory_test.go:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "testing"
+)
+
+import (
+ "dubbo.apache.org/dubbo-go/v3/common/extension"
+)
+
+func TestFactoryRegistered(t *testing.T) {
Review Comment:
Meaningless code.
##########
config_center/zookeeper/impl.go:
##########
@@ -115,8 +115,23 @@ func buildPath(rootPath, subPath string) string {
if !strings.HasPrefix(path, pathSeparator) {
path = pathSeparator + path
}
- path = strings.ReplaceAll(path, "//", "/")
- return path
+
+ // collapse consecutive slashes to a single slash
+ buf := make([]byte, 0, len(path))
Review Comment:
Please encapsulate the code in this area if necessary.
##########
config_center/parser/configuration_parser_test.go:
##########
@@ -33,6 +33,12 @@ func TestDefaultConfigurationParserParser(t *testing.T) {
assert.Equal(t, "172.0.0.1", m["dubbo.registry.address"])
}
+func TestDefaultConfigurationParserParse_Invalid(t *testing.T) {
Review Comment:
Meaningless code.
##########
config_center/nacos/facade_test.go:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nacos
+
+import (
+ "sync"
+ "testing"
+ "time"
+)
+
+import (
+ nacosClient "github.com/dubbogo/gost/database/kv/nacos"
+)
+
+import (
+ "dubbo.apache.org/dubbo-go/v3/common"
+)
+
+type mockFacade struct {
Review Comment:
Please stop mock eventhing.
##########
config_center/base_dynamic_configuration_test.go:
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package config_center
+
+import (
+ "testing"
+)
+
+func TestBaseDynamicConfigurationRemoveConfig(t *testing.T) {
Review Comment:
Meaningless test code.
##########
config_center/apollo/factory_test.go:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package apollo
+
+import (
+ "testing"
+)
+
+import (
+ "dubbo.apache.org/dubbo-go/v3/common/extension"
+)
+
+func TestFactoryRegistered(t *testing.T) {
Review Comment:
Meaningless code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]