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/rudder-server/services/controlplane
    
    the code of the file until where you have to start completion: package controlplane_test

import (
	"context"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/http/httptest"
	"os"
	"sync/atomic"
	"testing"
	"time"

	"github.com/stretchr/testify/require"

	backendconfig "github.com/rudderlabs/rudder-server/backend-config"
	"github.com/rudderlabs/rudder-server/services/controlplane"
	"github
    
func TestSendFeatures(t *testing.T) {
	validSecret := "valid-secret"

	wantBody := `{"components":[{"name":"test","features":["feature1","feature2"]}]}`

	testcases := []struct {
		name     string
		identity identity.Identifier

		wantPath string
		wantErr  error
	}{
		{
			name: "workspace",
			identity: &identity.Workspace{
				WorkspaceID:    "valid-workspace-id",
				WorkspaceToken: validSecret,
			},

			wantPath: "/data-plane/v1/workspaces/valid-workspace-id/settings",
			wantErr:  nil,
		},
		{
			name: "namespace",
			identity: &identity.Namespace{
				Namespace:    "valid-namespace",
				HostedSecret: validSecret,
			},
			wantPath: "/data-plane/v1/namespaces/valid-namespace/settings",
			wantErr:  nil,
		},
	}

	for _, tc := range testcases {
		tc := tc
		t.Run(tc.name, func(t *testing.T) {
			s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
				u, _, _ := r.BasicAuth()

				require.Equal(t, "application/json", r.Header.Get("Content-Type"))
				require.Contains(t, r.UserAgent(), "control-plane/features")
				require.Equal(t, validSecret, u)
				require.Equal(t, http.MethodPost, r.Method)
				require.Equal(t, tc.wantPath, r.URL.Path)

				body, err := io.ReadAll(r.Body)
				require.NoError(t, err)
				require.Equal(t, wantBody, string(body))

				w.WriteHeader(http.StatusNoContent)
			}))
			defer s.Close()

			c := controlplane.NewClient(s.URL, tc.identity, controlplane.WithHTTPClient(s.Client()))

			err := c.SendFeatures(context.Background(), "test", []string{"feature1", "feature2"})
			require.NoError(t, err)
		})
	}
}