Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions providers/azure/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions providers/azure/services/search/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
}
Expand Down Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions providers/azure/services/search/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions providers/azure/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading