Files
gb28181/internal/rpc/rpc_test.go
T
2026-01-08 13:14:12 +08:00

26 lines
546 B
Go

package rpc
import (
"context"
"log/slog"
"testing"
"github.com/gowvp/owl/protos"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
func TestHealthCheck(t *testing.T) {
addr := "localhost:50051"
conn, err := grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
t.Fatal(err)
}
cli := protos.NewHealthClient(conn)
resp, err := cli.Check(context.Background(), &protos.HealthCheckRequest{})
if err != nil {
t.Fatal(err)
}
slog.Info("HealthCheck", "resp", resp)
}