@@ -5,16 +5,15 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
bmemory "github.com/unistack-org/micro-broker-memory/v3"
|
||||
gclient "github.com/unistack-org/micro-client-grpc/v3"
|
||||
protocodec "github.com/unistack-org/micro-codec-proto/v3"
|
||||
rmemory "github.com/unistack-org/micro-register-memory/v3"
|
||||
regRouter "github.com/unistack-org/micro-router-register/v3"
|
||||
gserver "github.com/unistack-org/micro-server-grpc/v3"
|
||||
pb "github.com/unistack-org/micro-tests/server/grpc/proto"
|
||||
"github.com/unistack-org/micro/v3/broker"
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/errors"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/router"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
jsonpb "google.golang.org/protobuf/encoding/protojson"
|
||||
@@ -46,8 +45,8 @@ func (g *testServer) Call(ctx context.Context, req *pb.Request, rsp *pb.Response
|
||||
func TestGRPCServer(t *testing.T) {
|
||||
var err error
|
||||
|
||||
r := rmemory.NewRegister()
|
||||
b := bmemory.NewBroker(broker.Register(r))
|
||||
r := register.NewRegister()
|
||||
b := broker.NewBroker(broker.Register(r))
|
||||
s := gserver.NewServer(server.Codec("application/grpc+proto", protocodec.NewCodec()), server.Address(":12345"), server.Register(r), server.Name("helloworld"), gserver.Reflection(true),
|
||||
server.WrapHandler(NewServerHandlerWrapper()),
|
||||
)
|
||||
|
@@ -11,11 +11,11 @@ import (
|
||||
httpcli "github.com/unistack-org/micro-client-http/v3"
|
||||
jsoncodec "github.com/unistack-org/micro-codec-json/v3"
|
||||
jsonpbcodec "github.com/unistack-org/micro-codec-jsonpb/v3"
|
||||
memory "github.com/unistack-org/micro-register-memory/v3"
|
||||
httpsrv "github.com/unistack-org/micro-server-http/v3"
|
||||
pb "github.com/unistack-org/micro-tests/server/http/proto"
|
||||
"github.com/unistack-org/micro/v3/client"
|
||||
"github.com/unistack-org/micro/v3/metadata"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
)
|
||||
|
||||
@@ -61,7 +61,7 @@ func (h *Handler) CallError(ctx context.Context, req *pb.CallReq1, rsp *pb.CallR
|
||||
}
|
||||
|
||||
func TestNativeClientServer(t *testing.T) {
|
||||
reg := memory.NewRegister()
|
||||
reg := register.NewRegister()
|
||||
ctx := context.Background()
|
||||
|
||||
var mwfOk bool
|
||||
@@ -133,7 +133,7 @@ func TestNativeClientServer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNativeServer(t *testing.T) {
|
||||
reg := memory.NewRegister()
|
||||
reg := register.NewRegister()
|
||||
ctx := context.Background()
|
||||
|
||||
// create server
|
||||
@@ -214,7 +214,7 @@ func TestNativeServer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHTTPServer(t *testing.T) {
|
||||
reg := memory.NewRegister()
|
||||
reg := register.NewRegister()
|
||||
ctx := context.Background()
|
||||
|
||||
// create server
|
||||
|
@@ -8,11 +8,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
bmemory "github.com/unistack-org/micro-broker-memory/v3"
|
||||
rmemory "github.com/unistack-org/micro-register-memory/v3"
|
||||
tcp "github.com/unistack-org/micro-server-tcp/v3"
|
||||
"github.com/unistack-org/micro/v3/broker"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/register"
|
||||
"github.com/unistack-org/micro/v3/server"
|
||||
)
|
||||
|
||||
@@ -24,12 +23,12 @@ func TestTCPServer(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
logger.DefaultLogger = logger.NewLogger(logger.WithLevel(logger.TraceLevel))
|
||||
reg := rmemory.NewRegister()
|
||||
reg := register.NewRegister()
|
||||
if err := reg.Init(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
brk := bmemory.NewBroker(broker.Register(reg))
|
||||
brk := broker.NewBroker(broker.Register(reg))
|
||||
if err := brk.Init(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user