go-zero/zrpc/internal/serverinterceptors/prometheusinterceptor_test.go

20 lines
430 B
Go
Raw Normal View History

2020-08-22 23:08:33 +08:00
package serverinterceptors
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
)
func TestUnaryPromMetricInterceptor(t *testing.T) {
2020-09-27 17:15:15 +08:00
interceptor := UnaryPrometheusInterceptor()
2020-08-22 23:08:33 +08:00
_, err := interceptor(context.Background(), nil, &grpc.UnaryServerInfo{
FullMethod: "/",
}, func(ctx context.Context, req interface{}) (interface{}, error) {
return nil, nil
})
assert.Nil(t, err)
}