diff --git a/providers/azure/provider_test.go b/providers/azure/provider_test.go index 2487e771a..f728f1889 100644 --- a/providers/azure/provider_test.go +++ b/providers/azure/provider_test.go @@ -411,8 +411,8 @@ func TestAzureProvider_GetServiceClient_AllServiceTypes(t *testing.T) { }{ {common.ServiceCompute}, {common.ServiceRelationalDB}, - {common.ServiceCache}, {common.ServiceNoSQL}, + {common.ServiceCache}, {common.ServiceMemoryDB}, {common.ServiceSavingsPlans}, {common.ServiceSearch}, @@ -1159,8 +1159,8 @@ func TestAzureProvider_GetServiceClientForAccount(t *testing.T) { services := []common.ServiceType{ common.ServiceCompute, common.ServiceRelationalDB, - common.ServiceCache, common.ServiceNoSQL, + common.ServiceCache, common.ServiceMemoryDB, common.ServiceSavingsPlans, common.ServiceSearch, diff --git a/providers/azure/services/search/client.go b/providers/azure/services/search/client.go index e865ea61f..b695cc1f3 100644 --- a/providers/azure/services/search/client.go +++ b/providers/azure/services/search/client.go @@ -94,7 +94,7 @@ func (c *SearchClient) SetSearchServicesPager(pager SearchServicesPager) { // GetServiceType returns the service type func (c *SearchClient) GetServiceType() common.ServiceType { - return common.ServiceOther + return common.ServiceSearch } // GetRegion returns the region @@ -222,7 +222,7 @@ func (c *SearchClient) convertSearchReservation(detail *armconsumption.Reservati Provider: common.ProviderAzure, Account: c.subscriptionID, CommitmentType: common.CommitmentReservedInstance, - Service: common.ServiceOther, + Service: common.ServiceSearch, Region: c.region, State: "active", } @@ -556,7 +556,7 @@ func (c *SearchClient) convertAzureSearchRecommendation(ctx context.Context, azu rec := &common.Recommendation{ Provider: common.ProviderAzure, - Service: common.ServiceOther, + Service: common.ServiceSearch, Account: c.subscriptionID, CommitmentType: common.CommitmentReservedInstance, Timestamp: time.Now(), diff --git a/providers/azure/services/search/client_test.go b/providers/azure/services/search/client_test.go index 07e486aab..fcfa8ba5b 100644 --- a/providers/azure/services/search/client_test.go +++ b/providers/azure/services/search/client_test.go @@ -158,7 +158,7 @@ func TestNewClientWithHTTP(t *testing.T) { func TestSearchClient_GetServiceType(t *testing.T) { client := NewClient(nil, "sub", "region") - assert.Equal(t, common.ServiceOther, client.GetServiceType()) + assert.Equal(t, common.ServiceSearch, client.GetServiceType()) } func TestSearchClient_GetRegion(t *testing.T) { @@ -611,7 +611,7 @@ func TestSearchClient_ConvertAzureSearchRecommendation_PopulatesAllFields(t *tes rec := client.convertAzureSearchRecommendation(context.Background(), azRec) require.NotNil(t, rec) assert.Equal(t, common.ProviderAzure, rec.Provider) - assert.Equal(t, common.ServiceOther, rec.Service) + assert.Equal(t, common.ServiceSearch, rec.Service) assert.Equal(t, "test-subscription", rec.Account) assert.Equal(t, "eastus", rec.Region) assert.Equal(t, "standard2", rec.ResourceType) diff --git a/providers/azure/services_test.go b/providers/azure/services_test.go index 4836f3514..66daa9198 100644 --- a/providers/azure/services_test.go +++ b/providers/azure/services_test.go @@ -41,6 +41,14 @@ func TestNewManagedRedisClient(t *testing.T) { assert.Equal(t, "eastus", client.GetRegion()) } +func TestNewSearchClient(t *testing.T) { + client := NewSearchClient(nil, "test-subscription", "eastus") + + require.NotNil(t, client) + assert.Equal(t, common.ServiceSearch, client.GetServiceType()) + assert.Equal(t, "eastus", client.GetRegion()) +} + func TestNewRecommendationsClient(t *testing.T) { client, err := NewRecommendationsClient(nil, "test-subscription") require.NoError(t, err)