1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-16 02:47:03 +02:00
kratos/middleware/metrics/metrics_test.go
haiyux 00c05e82a3
test:remove testify go mod (#1766)
* test:remove testify go mod

* tidy go mdo

* fix test
2022-01-14 10:02:42 +08:00

22 lines
455 B
Go

package metrics
import (
"context"
"testing"
)
func TestMetrics(t *testing.T) {
next := func(ctx context.Context, req interface{}) (interface{}, error) {
return req.(string) + "https://go-kratos.dev", nil
}
_, err := Server()(next)(context.Background(), "test:")
if err != nil {
t.Errorf("expect %v, got %v", nil, err)
}
_, err = Client()(next)(context.Background(), "test:")
if err != nil {
t.Errorf("expect %v, got %v", nil, err)
}
}