Skip to content

Commit

Permalink
style: add comment for test func
Browse files Browse the repository at this point in the history
  • Loading branch information
zstone12 authored and Haswf committed Aug 28, 2022
1 parent 94c1525 commit 90e9154
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zookeeper/zookeeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import (
"github.com/stretchr/testify/assert"
)

func TestZookeeperRegistryAndDeregister(t *testing.T) {
// TestZookeeperRegistryWithHertz Test zookeeper registry complete workflow(service registry|service de-registry|service resolver)with hertz.
func TestZookeeperRegistryWithHertz(t *testing.T) {
address := "127.0.0.1:8888"
r, _ := NewZookeeperRegistry([]string{"127.0.0.1:2181"}, 40*time.Second)
srvName := "hertz.test.demo"
Expand Down Expand Up @@ -74,11 +75,12 @@ func TestZookeeperRegistryAndDeregister(t *testing.T) {
time.Sleep(5 * time.Second)

status1, body1, err1 := newClient.Get(context.Background(), nil, addr, config.WithSD(true))
assert.NotNil(t, err1)
assert.EqualError(t, err1, "instance not found")
assert.Equal(t, 0, status1)
assert.Equal(t, "", string(body1))
}

// TestZookeeperDiscovery Test zookeeper registry complete workflow(service registry|service de-registry|service resolver).
func TestZookeeperDiscovery(t *testing.T) {
// register
r, err := NewZookeeperRegistry([]string{"127.0.0.1:2181"}, 40*time.Second)
Expand Down Expand Up @@ -131,7 +133,8 @@ func TestZookeeperDiscovery(t *testing.T) {
assert.Equal(t, "product", result.CacheKey)
}

func TestZookeeperResolverWithAuth(t *testing.T) {
// TestZookeeperDiscoveryWithAuth Test zookeeper registry with auth complete workflow(service registry|service de-registry|service resolver).
func TestZookeeperDiscoveryWithAuth(t *testing.T) {
// register
r, err := NewZookeeperRegistryWithAuth([]string{"127.0.0.1:2181"}, 40*time.Second, "horizon", "horizon")
assert.Nil(t, err)
Expand Down

0 comments on commit 90e9154

Please # to comment.