@@ -104,9 +104,9 @@ func TestUpdateStorageCredentials(t *testing.T) {
104104 Method : "PATCH" ,
105105 Resource : "/api/2.1/unity-catalog/storage-credentials/a" ,
106106 ExpectedRequest : map [string ]interface {}{
107- "aws_iam_role" : [] interface {}{ map [string ]interface {}{
107+ "aws_iam_role" : map [string ]interface {}{
108108 "role_arn" : "CHANGED" ,
109- }} ,
109+ },
110110 },
111111 },
112112 {
@@ -178,3 +178,91 @@ func TestCreateStorageCredentialWithAzMI(t *testing.T) {
178178 ` ,
179179 }.ApplyNoError (t )
180180}
181+
182+ func TestUpdateAzStorageCredentials (t * testing.T ) {
183+ qa.ResourceFixture {
184+ Fixtures : []qa.HTTPFixture {
185+ {
186+ Method : "PATCH" ,
187+ Resource : "/api/2.1/unity-catalog/storage-credentials/a" ,
188+ ExpectedRequest : map [string ]interface {}{
189+ "azure_service_principal" : map [string ]interface {}{
190+ "directory_id" : "CHANGED" ,
191+ "application_id" : "CHANGED" ,
192+ "client_secret" : "CHANGED" ,
193+ },
194+ },
195+ },
196+ {
197+ Method : "GET" ,
198+ Resource : "/api/2.1/unity-catalog/storage-credentials/a" ,
199+ Response : StorageCredentialInfo {
200+ Name : "a" ,
201+ Azure : & AzureServicePrincipal {
202+ DirectoryID : "CHANGED" ,
203+ ApplicationID : "CHANGED" ,
204+ ClientSecret : "CHANGED" ,
205+ },
206+ MetastoreID : "d" ,
207+ },
208+ },
209+ },
210+ Resource : ResourceStorageCredential (),
211+ Update : true ,
212+ ID : "a" ,
213+ InstanceState : map [string ]string {
214+ "name" : "a" ,
215+ "comment" : "c" ,
216+ },
217+ HCL : `
218+ name = "a"
219+ azure_service_principal {
220+ directory_id = "CHANGED"
221+ application_id = "CHANGED"
222+ client_secret = "CHANGED"
223+ }
224+ comment = "c"
225+ ` ,
226+ }.ApplyNoError (t )
227+ }
228+
229+ func TestUpdateAzStorageCredentialMI (t * testing.T ) {
230+ qa.ResourceFixture {
231+ Fixtures : []qa.HTTPFixture {
232+ {
233+ Method : "PATCH" ,
234+ Resource : "/api/2.1/unity-catalog/storage-credentials/a" ,
235+ ExpectedRequest : map [string ]interface {}{
236+ "azure_managed_identity" : map [string ]interface {}{
237+ "access_connector_id" : "CHANGED" ,
238+ },
239+ },
240+ },
241+ {
242+ Method : "GET" ,
243+ Resource : "/api/2.1/unity-catalog/storage-credentials/a" ,
244+ Response : StorageCredentialInfo {
245+ Name : "a" ,
246+ AzMI : & AzureManagedIdentity {
247+ AccessConnectorID : "CHANGED" ,
248+ },
249+ MetastoreID : "d" ,
250+ },
251+ },
252+ },
253+ Resource : ResourceStorageCredential (),
254+ Update : true ,
255+ ID : "a" ,
256+ InstanceState : map [string ]string {
257+ "name" : "a" ,
258+ "comment" : "c" ,
259+ },
260+ HCL : `
261+ name = "a"
262+ azure_managed_identity {
263+ access_connector_id = "CHANGED"
264+ }
265+ comment = "c"
266+ ` ,
267+ }.ApplyNoError (t )
268+ }
0 commit comments