You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: client_test.go
    path of file: ./repos/sentinel-golang/pkg/adapters/hertz
    
    the code of the file until where you have to start completion: package hertz

import (
	"context"
	"net/http"
	"testing"

	sentinel "github.com/alibaba/sentinel-golang/api"
	"github.com/alibab
    
func TestClientSentinelMiddleware(t *testing.T) {
	type args struct {
		opts    []ClientOption
		method  string
		reqPath string
	}
	type want struct {
		code  int
		isErr bool
	}
	tests := []struct {
		name string
		args args
		want want
	}{
		{
			name: "default get",
			args: args{
				opts:    []ClientOption{},
				method:  http.MethodGet,
				reqPath: "http://localhost:3000/client_ping",
			},
			want: want{
				code:  http.StatusOK,
				isErr: false,
			},
		},
		{
			name: "customize resource extract",
			args: args{
				opts: []ClientOption{
					WithClientResourceExtractor(func(ctx context.Context, req *protocol.Request, resp *protocol.Response) string {
						return "/api/users/:id"
					}),
				},
				method:  http.MethodGet,
				reqPath: "http://localhost:3000/api/users/123",
			},
			want: want{
				code:  http.StatusTooManyRequests,
				isErr: true,
			},
		},
		{
			name: "customize block fallback",
			args: args{
				opts: []ClientOption{
					WithClientBlockFallback(func(ctx context.Context, req *protocol.Request, resp *protocol.Response, blockError error) error {
						resp.SetStatusCode(http.StatusBadRequest)
						return blockError
					}),
				},
				method:  http.MethodGet,
				reqPath: "http://localhost:3000/client_ping",
			},
			want: want{
				code:  http.StatusBadRequest,
				isErr: true,
			},
		},
	}
	go func() {
		h := server.New(server.WithHostPorts(":3000"))
		h.GET("/client_ping", func(c context.Context, ctx *app.RequestContext) {
			ctx.String(200, "pong")
		})
		h.GET("/api/users/:id", func(c context.Context, ctx *app.RequestContext) {
			ctx.String(200, "pong")
		})
		h.Spin()
	}()
	initSentinelForClient(t)
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			c, err := client.NewClient()
			if err != nil {
				t.Fatalf("Unexpected error: %+v", err)
				return
			}
			c.Use(SentinelClientMiddleware(tt.args.opts...))
			req := &protocol.Request{}
			res := &protocol.Response{}
			req.SetMethod(tt.args.method)
			req.SetRequestURI(tt.args.reqPath)
			err = c.Do(context.Background(), req, res)
			assert.Equal(t, tt.want.isErr, err != nil)
			assert.Equal(t, tt.want.code, res.StatusCode())
		})
	}
}