Skip to content
Snippets Groups Projects
Commit 8f920635 authored by cvictory's avatar cvictory
Browse files

fix nacos test

parent 206f8f0a
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ package nacos
import (
"encoding/json"
"net/http"
"strconv"
"testing"
)
......@@ -36,6 +37,9 @@ import (
)
func TestNacosMetadataReport_CRUD(t *testing.T) {
if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil {
return
}
rpt := newTestReport()
assert.NotNil(t, rpt)
......
......@@ -19,6 +19,7 @@ package nacos
import (
"encoding/json"
"net/http"
"net/url"
"strconv"
"testing"
......@@ -35,6 +36,9 @@ import (
)
func TestNacosRegistry_Register(t *testing.T) {
if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil {
return
}
regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)))
urlMap := url.Values{}
urlMap.Set(constant.GROUP_KEY, "guangzhou-idc")
......@@ -64,6 +68,9 @@ func TestNacosRegistry_Register(t *testing.T) {
}
func TestNacosRegistry_Subscribe(t *testing.T) {
if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil {
return
}
regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)))
urlMap := url.Values{}
urlMap.Set(constant.GROUP_KEY, "guangzhou-idc")
......@@ -102,6 +109,9 @@ func TestNacosRegistry_Subscribe(t *testing.T) {
}
func TestNacosRegistry_Subscribe_del(t *testing.T) {
if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil {
return
}
regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER)))
urlMap := url.Values{}
urlMap.Set(constant.GROUP_KEY, "guangzhou-idc")
......
......@@ -19,6 +19,7 @@ package nacos
import (
"math/rand"
"net/http"
"strconv"
"testing"
"time"
......@@ -81,6 +82,9 @@ func TestNacosServiceDiscovery_Destroy(t *testing.T) {
}
func TestNacosServiceDiscovery_CRUD(t *testing.T) {
if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil {
return
}
prepareData()
extension.SetEventDispatcher("mock", func() observer.EventDispatcher {
return &dispatcher.MockEventDispatcher{}
......
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