1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-02-05 13:15:11 +02:00
kratos/transport/http/handle_test.go

25 lines
438 B
Go
Raw Normal View History

package http
import (
"context"
"testing"
)
type HelloRequest struct {
Name string `json:"name"`
}
type HelloReply struct {
Message string `json:"message"`
}
type GreeterService struct {
}
func (s *GreeterService) SayHello(ctx context.Context, req *HelloRequest) (*HelloReply, error) {
return &HelloReply{Message: "hello " + req.Name}, nil
}
func TestHandler(t *testing.T) {
s := &GreeterService{}
_ = NewHandler(s.SayHello)
}