You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
kratos/app_test.go

25 lines
406 B

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)
}
}