Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmay-db committed Jan 31, 2024
1 parent 7932c78 commit 4e5e8af
Showing 1 changed file with 4 additions and 59 deletions.
63 changes: 4 additions & 59 deletions catalog/resource_metastore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"},
Expand All @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"},
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 4e5e8af

Please sign in to comment.