mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-27 20:38:41 +08:00
20 lines
430 B
Go
20 lines
430 B
Go
|
package serverinterceptors
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"google.golang.org/grpc"
|
||
|
)
|
||
|
|
||
|
func TestUnaryPromMetricInterceptor(t *testing.T) {
|
||
|
interceptor := UnaryPromMetricInterceptor()
|
||
|
_, err := interceptor(context.Background(), nil, &grpc.UnaryServerInfo{
|
||
|
FullMethod: "/",
|
||
|
}, func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return nil, nil
|
||
|
})
|
||
|
assert.Nil(t, err)
|
||
|
}
|