package agent

import (
	"context"
	"testing"

	"github.com/stretchr/testify/require"
	"go.uber.org/mock/gomock"

	agentapi "github.com/tidbcloud/aisupport/packages/sdk-go/contracts/api/agent-gateway/agent/v1"
	serviceapi "github.com/tidbcloud/aisupport/services/agent-gateway/internal/services/agent/api"
)

func TestListAgentsDoesNotRequireOperator(t *testing.T) {
	t.Parallel()

	ctrl := gomock.NewController(t)
	service := serviceapi.NewMockManagement(ctrl)
	service.EXPECT().ListAgents(gomock.Any(), &agentapi.ListAgentsRequest{}).Return(&agentapi.ListAgentsResponse{}, nil)
	handler := &Handler{service: service}

	_, err := handler.ListAgents(context.Background(), &agentapi.ListAgentsRequest{})

	require.NoError(t, err)
}
