1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-03 22:52:24 +02:00
kratos/app_test.go
2021-02-17 17:14:47 +08:00

26 lines
406 B
Go

package kratos
import (
"testing"
"time"
"github.com/go-kratos/kratos/v2/transport/grpc"
"github.com/go-kratos/kratos/v2/transport/http"
)
func TestApp(t *testing.T) {
hs := http.NewServer()
gs := grpc.NewServer()
app := New(
Name("kratos"),
Version("v1.0.0"),
Server(hs, gs),
)
time.AfterFunc(time.Second, func() {
app.Stop()
})
if err := app.Run(); err != nil {
t.Fatal(err)
}
}