From ceceb23b228bebb9b991080d3afc9e86dffb4779 Mon Sep 17 00:00:00 2001 From: Zeki Sherif Date: Wed, 30 Oct 2024 07:18:53 -0500 Subject: [PATCH] fix: rg api tests --- api/resource_groups_test.go | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/api/resource_groups_test.go b/api/resource_groups_test.go index f6cb1ab81..8b38dbee5 100644 --- a/api/resource_groups_test.go +++ b/api/resource_groups_test.go @@ -52,22 +52,26 @@ func TestFindResourceGroupType(t *testing.T) { assert.True(t, found, "resource group type should exist") assert.Equal(t, "AWS", groupFound.String(), "wrong resource group type") - groupFound, found = api.FindResourceGroupType("AWS") + groupFound, found = api.FindResourceGroupType("GCP") assert.True(t, found, "resource group type should exist") - assert.Equal(t, "AWS", groupFound.String(), "wrong resource group type") + assert.Equal(t, "GCP", groupFound.String(), "wrong resource group type") - groupFound, found = api.FindResourceGroupType("CONTAINER") + groupFound, found = api.FindResourceGroupType("AZURE") assert.True(t, found, "resource group type should exist") - assert.Equal(t, "CONTAINER", groupFound.String(), "wrong resource group type") + assert.Equal(t, "AZURE", groupFound.String(), "wrong resource group type") - groupFound, found = api.FindResourceGroupType("GCP") + groupFound, found = api.FindResourceGroupType("CONTAINER") assert.True(t, found, "resource group type should exist") - assert.Equal(t, "GCP", groupFound.String(), "wrong resource group type") + assert.Equal(t, "CONTAINER", groupFound.String(), "wrong resource group type") groupFound, found = api.FindResourceGroupType("MACHINE") assert.True(t, found, "resource group type should exist") assert.Equal(t, "MACHINE", groupFound.String(), "wrong resource group type") + groupFound, found = api.FindResourceGroupType("OCI") + assert.True(t, found, "resource group type should exist") + assert.Equal(t, "OCI", groupFound.String(), "wrong resource group type") + groupFound, found = api.FindResourceGroupType("KUBERNETES") assert.True(t, found, "resource group type should exist") assert.Equal(t, "KUBERNETES", groupFound.String(), "wrong resource group type") @@ -196,17 +200,17 @@ func TestResourceGroupsDelete(t *testing.T) { func TestResourceGroupsList(t *testing.T) { var ( - awsResourceGUIDs = []string{intgguid.New(), intgguid.New()} - azureResourceGUIDs = []string{intgguid.New(), intgguid.New()} - containerResourceGUIDs = []string{intgguid.New()} - gcpResourceGUIDs = []string{intgguid.New()} - machineResourceGUIDs = []string{intgguid.New()} - ociResourceGUIDs = []string{intgguid.New()} + awsResourceGUIDs = []string{intgguid.New(), intgguid.New()} + azureResourceGUIDs = []string{intgguid.New(), intgguid.New()} + containerResourceGUIDs = []string{intgguid.New()} + gcpResourceGUIDs = []string{intgguid.New()} + machineResourceGUIDs = []string{intgguid.New()} + ociResourceGUIDs = []string{intgguid.New()} kubernetesResourceGUIDs = []string{intgguid.New()} - allGroups = [][]string{awsResourceGUIDs, azureResourceGUIDs, containerResourceGUIDs, + allGroups = [][]string{awsResourceGUIDs, azureResourceGUIDs, containerResourceGUIDs, gcpResourceGUIDs, machineResourceGUIDs, ociResourceGUIDs, kubernetesResourceGUIDs} - allGuids []string - fakeServer = lacework.MockServer() + allGuids []string + fakeServer = lacework.MockServer() ) for _, guids := range allGroups {