package dataservice

import (
	"context"
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/tidbcloud/observability/pkg/common/constants"
	"github.com/tidbcloud/observability/pkg/common/message"
)

func TestGetServiceHandler(t *testing.T) {
	first := GetServiceHandler()
	assert.Equal(t, serviceHandler, first)
	second := GetServiceHandler()
	assert.Equal(t, serviceHandler, second)
}

func TestServiceHandler_ServiceInfo(t *testing.T) {
	resp, err := GetServiceHandler().ServiceInfo(context.TODO())
	assert.NoError(t, err)
	assert.Equal(t, resp, message.GetServiceInfoResp{
		ServiceName: constants.ObservabilityRegionalDataServer,
	})
}
