nats: use new repo path

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2019-05-21 15:13:58 +03:00
parent 4ac1ad4a6b
commit 29684f038e
3 changed files with 10 additions and 6 deletions

View File

@ -10,7 +10,7 @@ import (
"github.com/micro/go-micro/broker"
"github.com/micro/go-micro/cmd"
"github.com/micro/go-micro/codec/json"
nats "github.com/nats-io/go-nats"
nats "github.com/nats-io/nats.go"
)
type nbroker struct {

View File

@ -5,7 +5,7 @@ import (
"testing"
"github.com/micro/go-micro/broker"
"github.com/nats-io/go-nats"
nats "github.com/nats-io/nats.go"
)
var addrTestCases = []struct {
@ -38,7 +38,9 @@ var addrTestCases = []struct {
"default",
"check if default Address is set correctly",
map[string]string{
"nats://localhost:4222": ""},
"nats://localhost:4222": "",
"nats://127.0.0.1:4222": "",
},
},
}
@ -78,8 +80,10 @@ func TestInitAddrs(t *testing.T) {
if !ok {
t.Fatal("Expected broker to be of types *nbroker")
}
// check if the same amount of addrs we set has actually been set
if len(natsBroker.addrs) != len(tc.addrs) {
// check if the same amount of addrs we set has actually been set, default
// have only 1 address nats://127.0.0.1:4222 (current nats code) or
// nats://localhost:4222 (older code version)
if len(natsBroker.addrs) != len(tc.addrs) && tc.name != "default" {
t.Errorf("Expected Addr count = %d, Actual Addr count = %d",
len(natsBroker.addrs), len(tc.addrs))
}

View File

@ -2,7 +2,7 @@ package nats
import (
"github.com/micro/go-micro/broker"
nats "github.com/nats-io/go-nats"
nats "github.com/nats-io/nats.go"
)
type optionsKey struct{}