service: add simple test
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
5c565594aa
commit
902848c621
22
service/service_test.go
Normal file
22
service/service_test.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package service
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
httpcli "github.com/unistack-org/micro-client-http/v3"
|
||||||
|
httpsrv "github.com/unistack-org/micro-server-http/v3"
|
||||||
|
"github.com/unistack-org/micro/v3"
|
||||||
|
"github.com/unistack-org/micro/v3/server"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestHTTPService(t *testing.T) {
|
||||||
|
svc := micro.NewService(
|
||||||
|
micro.Server(httpsrv.NewServer(server.Address("127.0.0.1:0"))),
|
||||||
|
micro.Client(httpcli.NewClient()),
|
||||||
|
)
|
||||||
|
|
||||||
|
if err := svc.Init(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user