Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
orestisfl committed Sep 29, 2023
1 parent f3ffd3d commit 5367f55
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions resources/fetching/fetchers/azure/assets_fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,25 @@ func (s *AzureAssetsFetcherTestSuite) TestFetcher_Fetch() {
ctx := context.Background()

mockInventoryService := &inventory.MockServiceAPI{}
mockAssets := []inventory.AzureAsset{
{
Id: "id1",
Name: "name1",
Location: "location1",
Properties: map[string]interface{}{"key1": "value1"},
ResourceGroup: "rg1",
SubscriptionId: "subId1",
TenantId: "tenantId1",
Type: inventory.VirtualMachineAssetType,
},
{
Id: "id2",
Name: "name2",
Location: "location2",
Properties: map[string]interface{}{"key2": "value2"},
ResourceGroup: "rg2",
SubscriptionId: "subId2",
TenantId: "tenantId2",
Type: inventory.StorageAccountAssetType,
},
var mockAssets []inventory.AzureAsset
for _, assetType := range []string{
inventory.DiskAssetType,
inventory.StorageAccountAssetType,
inventory.VirtualMachineAssetType,
} {
mockAssets = append(mockAssets,
inventory.AzureAsset{
Id: "id",
Name: "name",
Location: "location",
Properties: map[string]interface{}{"key": "value"},
ResourceGroup: "rg",
SubscriptionId: "subId",
TenantId: "tenantId",
Type: assetType,
},
)
}

mockInventoryService.EXPECT().
ListAllAssetTypesByName(mock.AnythingOfType("[]string")).
Return(mockAssets, nil).Once()
Expand Down

0 comments on commit 5367f55

Please sign in to comment.