broker: refactor (#396)
* remove subscribe from server * remove publish from client * broker package refactoring Co-authored-by: vtolstov <vtolstov@users.noreply.github.com> Reviewed-on: #396 Co-authored-by: Vasiliy Tolstov <v.tolstov@unistack.org> Co-committed-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package micro
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
@@ -80,41 +79,6 @@ func TestRegisterHandler(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegisterSubscriber(t *testing.T) {
|
||||
type args struct {
|
||||
topic string
|
||||
s server.Server
|
||||
h interface{}
|
||||
opts []server.SubscriberOption
|
||||
}
|
||||
h := func(_ context.Context, _ interface{}) error {
|
||||
return nil
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "RegisterSubscriber",
|
||||
args: args{
|
||||
topic: "test",
|
||||
s: server.DefaultServer,
|
||||
h: h,
|
||||
opts: nil,
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if err := RegisterSubscriber(tt.args.topic, tt.args.s, tt.args.h, tt.args.opts...); (err != nil) != tt.wantErr {
|
||||
t.Errorf("RegisterSubscriber() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewService(t *testing.T) {
|
||||
type args struct {
|
||||
opts []Option
|
||||
|
Reference in New Issue
Block a user