mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-03 22:52:24 +02:00
26 lines
406 B
Go
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)
|
|
}
|
|
}
|