@@ -282,6 +282,102 @@ func TestResourceAttributes_ApplyOverrides(t *testing.T) {
282282 },
283283 },
284284 },
285+ "matching overrides computed" : {
286+ overrides : map [string ]explorer.Override {
287+ "string_attribute" : {
288+ ComputedOptionalRequired : "computed" ,
289+ },
290+ },
291+ attributes : attrmapper.ResourceAttributes {
292+ & attrmapper.ResourceStringAttribute {
293+ Name : "string_attribute" ,
294+ StringAttribute : resource.StringAttribute {
295+ ComputedOptionalRequired : schema .Required ,
296+ },
297+ },
298+ },
299+ expectedAttributes : attrmapper.ResourceAttributes {
300+ & attrmapper.ResourceStringAttribute {
301+ Name : "string_attribute" ,
302+ StringAttribute : resource.StringAttribute {
303+ ComputedOptionalRequired : schema .Computed ,
304+ Description : pointer ("" ),
305+ },
306+ },
307+ },
308+ },
309+ "matching overrides optional" : {
310+ overrides : map [string ]explorer.Override {
311+ "string_attribute" : {
312+ ComputedOptionalRequired : "optional" ,
313+ },
314+ },
315+ attributes : attrmapper.ResourceAttributes {
316+ & attrmapper.ResourceStringAttribute {
317+ Name : "string_attribute" ,
318+ StringAttribute : resource.StringAttribute {
319+ ComputedOptionalRequired : schema .Required ,
320+ },
321+ },
322+ },
323+ expectedAttributes : attrmapper.ResourceAttributes {
324+ & attrmapper.ResourceStringAttribute {
325+ Name : "string_attribute" ,
326+ StringAttribute : resource.StringAttribute {
327+ ComputedOptionalRequired : schema .Optional ,
328+ Description : pointer ("" ),
329+ },
330+ },
331+ },
332+ },
333+ "matching overrides required" : {
334+ overrides : map [string ]explorer.Override {
335+ "string_attribute" : {
336+ ComputedOptionalRequired : "required" ,
337+ },
338+ },
339+ attributes : attrmapper.ResourceAttributes {
340+ & attrmapper.ResourceStringAttribute {
341+ Name : "string_attribute" ,
342+ StringAttribute : resource.StringAttribute {
343+ ComputedOptionalRequired : schema .Computed ,
344+ },
345+ },
346+ },
347+ expectedAttributes : attrmapper.ResourceAttributes {
348+ & attrmapper.ResourceStringAttribute {
349+ Name : "string_attribute" ,
350+ StringAttribute : resource.StringAttribute {
351+ ComputedOptionalRequired : schema .Required ,
352+ Description : pointer ("" ),
353+ },
354+ },
355+ },
356+ },
357+ "matching overrides computed_optional" : {
358+ overrides : map [string ]explorer.Override {
359+ "string_attribute" : {
360+ ComputedOptionalRequired : "computed_optional" ,
361+ },
362+ },
363+ attributes : attrmapper.ResourceAttributes {
364+ & attrmapper.ResourceStringAttribute {
365+ Name : "string_attribute" ,
366+ StringAttribute : resource.StringAttribute {
367+ ComputedOptionalRequired : schema .Computed ,
368+ },
369+ },
370+ },
371+ expectedAttributes : attrmapper.ResourceAttributes {
372+ & attrmapper.ResourceStringAttribute {
373+ Name : "string_attribute" ,
374+ StringAttribute : resource.StringAttribute {
375+ ComputedOptionalRequired : schema .ComputedOptional ,
376+ Description : pointer ("" ),
377+ },
378+ },
379+ },
380+ },
285381 "matching nested overrides" : {
286382 overrides : map [string ]explorer.Override {
287383 "single_nested" : {
0 commit comments