update go-micro and fix client/selector usage

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-07-17 01:29:28 +03:00
parent 7142b4b30e
commit 0d8a516ec9
3 changed files with 7 additions and 10 deletions

View File

@@ -5,20 +5,19 @@ import (
"testing"
"github.com/micro/go-micro/v2/client"
"github.com/micro/go-micro/v2/client/selector"
"github.com/micro/go-micro/v2/errors"
"github.com/micro/go-micro/v2/registry/memory"
"github.com/micro/go-micro/v2/router"
"github.com/sony/gobreaker"
)
func TestBreaker(t *testing.T) {
// setup
r := memory.NewRegistry()
s := selector.NewSelector(selector.Registry(r))
c := client.NewClient(
// set the selector
client.Selector(s),
client.Router(rrouter.NewRouter(router.Registry(registry))),
// add the breaker wrapper
client.Wrap(NewClientWrapper()),
)
@@ -48,11 +47,10 @@ func TestBreaker(t *testing.T) {
func TestCustomBreaker(t *testing.T) {
// setup
r := memory.NewRegistry()
s := selector.NewSelector(selector.Registry(r))
c := client.NewClient(
// set the selector
client.Selector(s),
client.Router(rrouter.NewRouter(router.Registry(registry))),
// add the breaker wrapper
client.Wrap(NewCustomClientWrapper(
gobreaker.Settings{},