fixup multiple client handling
Some checks failed
lint / lint (pull_request) Failing after 1m28s
pr / test (pull_request) Failing after 2m39s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-11-13 08:22:51 +03:00
parent 92474de685
commit b64a93ad2d

View File

@ -18,8 +18,8 @@ import (
)
func TestClient(t *testing.T) {
c1 := client.NewClient(client.Name("test1"))
c2 := client.NewClient(client.Name("test2"))
c1 := client.NewClient(options.Name("test1"))
c2 := client.NewClient(options.Name("test2"))
svc := NewService(Client(c1, c2))
if err := svc.Init(); err != nil {
@ -32,23 +32,6 @@ func TestClient(t *testing.T) {
}
}
type testItem struct {
name string
}
func (ti *testItem) Name() string {
return ti.name
}
func TestGetNameIndex(t *testing.T) {
item1 := &testItem{name: "first"}
item2 := &testItem{name: "second"}
items := []interface{}{item1, item2}
if idx := getNameIndex("second", items); idx != 1 {
t.Fatalf("getNameIndex func error, item not found")
}
}
func TestRegisterHandler(t *testing.T) {
type args struct {
s server.Server