1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-04-13 11:50:53 +02:00
kratos/middleware/metrics/metrics_test.go
Kagaya f7588a47de
fix: ci lint error (#1391)
* fix lint check

* fix lll lint error

* fix build error

* fix gomnd

* fix shadow declaration

* add make test command

* update
2021-08-31 10:14:57 +08:00

20 lines
424 B
Go

package metrics
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
)
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:")
assert.Equal(t, err, nil)
_, err = Client()(next)(context.Background(), "test:")
assert.Equal(t, err, nil)
}