Skip to content

Commit

Permalink
fix existing test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kubasobon committed Jan 21, 2025
1 parent 3906d04 commit c908c66
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions internal/inventory/azurefetcher/fetcher_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ func TestStorageFetcher_Fetch(t *testing.T) {
Name: "queue",
DisplayName: "queue",
}
azureTableService := azurelib_inventory.AzureAsset{
Id: "queue",
Name: "queue",
DisplayName: "queue",
}

expected := []inventory.AssetEvent{
inventory.NewAssetEvent(
Expand Down Expand Up @@ -83,6 +88,16 @@ func TestStorageFetcher_Fetch(t *testing.T) {
ServiceName: "Azure",
}),
),
inventory.NewAssetEvent(
inventory.AssetClassificationAzureStorageTableService,
azureQueue.Id,
azureQueue.Name,
inventory.WithRawAsset(azureTableService),
inventory.WithCloud(inventory.Cloud{
Provider: inventory.AzureCloudProvider,
ServiceName: "Azure",
}),
),
}

// setup
Expand Down Expand Up @@ -119,6 +134,12 @@ func TestStorageFetcher_Fetch(t *testing.T) {
[]azurelib_inventory.AzureAsset{azureQueue}, nil,
)

provider.EXPECT().ListStorageAccountTableServices(
mock.Anything, mock.Anything,
).Return(
[]azurelib_inventory.AzureAsset{azureTableService}, nil,
)

fetcher := newStorageFetcher(logger, provider)
// test & compare
testutil.CollectResourcesAndMatch(t, fetcher, expected)
Expand Down

0 comments on commit c908c66

Please sign in to comment.