From 4e5e8af5bcda57408f3c23cc274ca2ac0a9348f0 Mon Sep 17 00:00:00 2001 From: Tanmay Rustagi Date: Wed, 31 Jan 2024 17:35:55 +0100 Subject: [PATCH] fix tests --- catalog/resource_metastore_test.go | 63 ++---------------------------- 1 file changed, 4 insertions(+), 59 deletions(-) diff --git a/catalog/resource_metastore_test.go b/catalog/resource_metastore_test.go index 0a4e1940cf..7eb998b48e 100644 --- a/catalog/resource_metastore_test.go +++ b/catalog/resource_metastore_test.go @@ -172,17 +172,6 @@ func TestUpdateMetastore_NoChanges(t *testing.T) { StorageRoot: "s3://b/abc", Name: "abc", }, nil) - e.Update(mock.Anything, catalog.UpdateMetastore{ - Id: "abc", - Name: "abc", - DeltaSharingScope: "INTERNAL_AND_EXTERNAL", - DeltaSharingRecipientTokenLifetimeInSeconds: 1002, - ForceSendFields: []string{"DeltaSharingRecipientTokenLifetimeInSeconds"}, - }).Return(&catalog.MetastoreInfo{ - Name: "a", - DeltaSharingScope: "INTERNAL_AND_EXTERNAL", - DeltaSharingRecipientTokenLifetimeInSeconds: 1002, - }, nil) }, Resource: ResourceMetastore(), ID: "abc", @@ -216,18 +205,6 @@ func TestUpdateMetastore_OwnerChanges(t *testing.T) { Name: "abc", Owner: "updatedOwner", }, nil) - e.Update(mock.Anything, catalog.UpdateMetastore{ - Id: "abc", - Name: "abc", - DeltaSharingScope: "INTERNAL_AND_EXTERNAL", - DeltaSharingRecipientTokenLifetimeInSeconds: 1002, - ForceSendFields: []string{"DeltaSharingRecipientTokenLifetimeInSeconds"}, - }).Return(&catalog.MetastoreInfo{ - Name: "a", - Owner: "updatedOwner", - DeltaSharingScope: "INTERNAL_AND_EXTERNAL", - DeltaSharingRecipientTokenLifetimeInSeconds: 1002, - }, nil) e.GetById(mock.Anything, "abc").Return(&catalog.MetastoreInfo{ Name: "abc", Owner: "updatedOwner", @@ -269,7 +246,7 @@ func TestUpdateMetastore_Rollback(t *testing.T) { }, nil) e.Update(mock.Anything, catalog.UpdateMetastore{ Id: "abc", - Name: "abc", + Name: "abcd", DeltaSharingScope: "INTERNAL_AND_EXTERNAL", DeltaSharingRecipientTokenLifetimeInSeconds: 1002, ForceSendFields: []string{"DeltaSharingRecipientTokenLifetimeInSeconds"}, @@ -294,7 +271,7 @@ func TestUpdateMetastore_Rollback(t *testing.T) { "delta_sharing_recipient_token_lifetime_in_seconds": "1002", }, HCL: ` - name = "abc" + name = "abcd" storage_root = "s3:/a" owner = "updatedOwner" delta_sharing_scope = "INTERNAL_AND_EXTERNAL" @@ -507,22 +484,6 @@ func TestUpdateAccountMetastore_NoChanges(t *testing.T) { qa.ResourceFixture{ MockAccountClientFunc: func(a *mocks.MockAccountClient) { e := a.GetMockAccountMetastoresAPI().EXPECT() - e.Update(mock.Anything, catalog.AccountsUpdateMetastore{ - MetastoreId: "abc", - MetastoreInfo: &catalog.UpdateMetastore{ - Id: "abc", - Name: "abc", - DeltaSharingScope: "INTERNAL_AND_EXTERNAL", - DeltaSharingRecipientTokenLifetimeInSeconds: 1002, - ForceSendFields: []string{"DeltaSharingRecipientTokenLifetimeInSeconds"}, - }, - }).Return(&catalog.AccountsMetastoreInfo{ - MetastoreInfo: &catalog.MetastoreInfo{ - Name: "abc", - DeltaSharingScope: "INTERNAL_AND_EXTERNAL", - DeltaSharingRecipientTokenLifetimeInSeconds: 1002, - }, - }, nil) e.GetByMetastoreId(mock.Anything, "abc").Return(&catalog.AccountsMetastoreInfo{ MetastoreInfo: &catalog.MetastoreInfo{ StorageRoot: "s3://b/abc", @@ -569,22 +530,6 @@ func TestUpdateAccountMetastore_OwnerChanges(t *testing.T) { Owner: "updatedOwner", }, }, nil) - e.Update(mock.Anything, catalog.AccountsUpdateMetastore{ - MetastoreId: "abc", - MetastoreInfo: &catalog.UpdateMetastore{ - Id: "abc", - Name: "abc", - DeltaSharingScope: "INTERNAL_AND_EXTERNAL", - DeltaSharingRecipientTokenLifetimeInSeconds: 1002, - ForceSendFields: []string{"DeltaSharingRecipientTokenLifetimeInSeconds"}, - }, - }).Return(&catalog.AccountsMetastoreInfo{ - MetastoreInfo: &catalog.MetastoreInfo{ - Name: "abc", - DeltaSharingScope: "INTERNAL_AND_EXTERNAL", - DeltaSharingRecipientTokenLifetimeInSeconds: 1002, - }, - }, nil) e.GetByMetastoreId(mock.Anything, "abc").Return(&catalog.AccountsMetastoreInfo{ MetastoreInfo: &catalog.MetastoreInfo{ StorageRoot: "s3://b/abc", @@ -635,7 +580,7 @@ func TestUpdateAccountMetastore_Rollback(t *testing.T) { MetastoreId: "abc", MetastoreInfo: &catalog.UpdateMetastore{ Id: "abc", - Name: "abc", + Name: "abcd", DeltaSharingScope: "INTERNAL_AND_EXTERNAL", DeltaSharingRecipientTokenLifetimeInSeconds: 1002, ForceSendFields: []string{"DeltaSharingRecipientTokenLifetimeInSeconds"}, @@ -667,7 +612,7 @@ func TestUpdateAccountMetastore_Rollback(t *testing.T) { "delta_sharing_recipient_token_lifetime_in_seconds": "1002", }, HCL: ` - name = "abc" + name = "abcd" storage_root = "s3:/a" owner = "updatedOwner" delta_sharing_scope = "INTERNAL_AND_EXTERNAL"