1package testhelper_test
2
3import (
4	"testing"
5
6	"github.com/stretchr/testify/require"
7	"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper"
8	"google.golang.org/grpc"
9)
10
11func TestSetCtxGrpcMethod(t *testing.T) {
12	expectFullMethodName := "/pinkypb/TakeOverTheWorld.SNARF"
13
14	ctx, cancel := testhelper.Context()
15	defer cancel()
16
17	ctx = testhelper.SetCtxGrpcMethod(ctx, expectFullMethodName)
18
19	actualFullMethodName, ok := grpc.Method(ctx)
20	require.True(t, ok, "expected context to contain server transport stream")
21	require.Equal(t, expectFullMethodName, actualFullMethodName)
22}
23