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