Skip to content
Snippets Groups Projects
Commit f7c588d2 authored by 邹毅贤's avatar 邹毅贤
Browse files

fix review comment

parent b2584ae3
No related branches found
No related tags found
package nacos
import (
"fmt"
"strings"
"testing"
)
......@@ -23,14 +22,10 @@ func Test_newNacosClient(t *testing.T) {
done: make(chan struct{}),
}
err := ValidateNacosClient(c, WithNacosName(nacosClientName))
if err != nil {
fmt.Println("nacos client start error ,error message is", err)
}
assert.NoError(t, err)
c.wg.Add(1)
go HandleClientRestart(c)
c.client.Close()
<-c.client.Done()
fmt.Println("nacos client close done")
c.Destroy()
}
......@@ -77,14 +77,10 @@ func initNacosData(t *testing.T) (*nacosDynamicConfiguration, error) {
nacosURL := strings.ReplaceAll(server.URL, "http", "registry")
regurl, _ := common.NewURL(nacosURL)
nacosConfiguration, err := newNacosDynamicConfiguration(&regurl)
if err != nil {
fmt.Println("error:newNacosDynamicConfiguration", err.Error())
assert.NoError(t, err)
return nil, err
}
assert.NoError(t, err)
nacosConfiguration.SetParser(&parser.DefaultConfigurationParser{})
assert.NoError(t, err)
return nacosConfiguration, err
}
......@@ -104,10 +100,7 @@ func Test_AddListener(t *testing.T) {
time.Sleep(time.Second * 2)
nacos.AddListener("dubbo.properties", listener)
listener.wg.Add(1)
fmt.Println("begin to listen")
listener.wg.Wait()
fmt.Println("end", listener.event)
}
func Test_RemoveListener(t *testing.T) {
......@@ -120,7 +113,6 @@ type mockDataListener struct {
}
func (l *mockDataListener) Process(configType *config_center.ConfigChangeEvent) {
fmt.Println("process!!!!!!!!!!")
l.wg.Done()
l.event = configType.Key
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment