@@ -17,7 +17,6 @@ import (
17
17
"github.com/hashicorp/terraform-plugin-framework/resource"
18
18
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
19
19
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
20
- "github.com/hashicorp/terraform-plugin-framework/types"
21
20
)
22
21
23
22
func TestServerUpgradeResourceState (t * testing.T ) {
@@ -85,18 +84,15 @@ func TestServerUpgradeResourceState(t *testing.T) {
85
84
UpgradeStateMethod : func (ctx context.Context ) map [int64 ]resource.StateUpgrader {
86
85
return map [int64 ]resource.StateUpgrader {
87
86
0 : {
88
- PriorSchema : & tfsdk.Schema {
89
- Attributes : map [string ]tfsdk.Attribute {
90
- "id" : {
91
- Type : types .StringType ,
87
+ PriorSchema : & schema.Schema {
88
+ Attributes : map [string ]schema.Attribute {
89
+ "id" : schema.StringAttribute {
92
90
Computed : true ,
93
91
},
94
- "optional_attribute" : {
95
- Type : types .BoolType ,
92
+ "optional_attribute" : schema.BoolAttribute {
96
93
Optional : true ,
97
94
},
98
- "required_attribute" : {
99
- Type : types .BoolType ,
95
+ "required_attribute" : schema.BoolAttribute {
100
96
Required : true ,
101
97
},
102
98
},
@@ -411,18 +407,15 @@ func TestServerUpgradeResourceState(t *testing.T) {
411
407
UpgradeStateMethod : func (ctx context.Context ) map [int64 ]resource.StateUpgrader {
412
408
return map [int64 ]resource.StateUpgrader {
413
409
0 : {
414
- PriorSchema : & tfsdk.Schema {
415
- Attributes : map [string ]tfsdk.Attribute {
416
- "id" : {
417
- Type : types .StringType ,
410
+ PriorSchema : & schema.Schema {
411
+ Attributes : map [string ]schema.Attribute {
412
+ "id" : schema.StringAttribute {
418
413
Computed : true ,
419
414
},
420
- "optional_attribute" : {
421
- Type : types .Int64Type , // Purposefully incorrect
415
+ "optional_attribute" : schema.Int64Attribute { // Purposefully incorrect
422
416
Optional : true ,
423
417
},
424
- "required_attribute" : {
425
- Type : types .Int64Type , // Purposefully incorrect
418
+ "required_attribute" : schema.Int64Attribute { // Purposefully incorrect
426
419
Required : true ,
427
420
},
428
421
},
@@ -462,18 +455,15 @@ func TestServerUpgradeResourceState(t *testing.T) {
462
455
UpgradeStateMethod : func (ctx context.Context ) map [int64 ]resource.StateUpgrader {
463
456
return map [int64 ]resource.StateUpgrader {
464
457
0 : {
465
- PriorSchema : & tfsdk.Schema {
466
- Attributes : map [string ]tfsdk.Attribute {
467
- "id" : {
468
- Type : types .StringType ,
458
+ PriorSchema : & schema.Schema {
459
+ Attributes : map [string ]schema.Attribute {
460
+ "id" : schema.StringAttribute {
469
461
Computed : true ,
470
462
},
471
- "optional_attribute" : {
472
- Type : types .BoolType ,
463
+ "optional_attribute" : schema.BoolAttribute {
473
464
Optional : true ,
474
465
},
475
- "required_attribute" : {
476
- Type : types .BoolType ,
466
+ "required_attribute" : schema.BoolAttribute {
477
467
Required : true ,
478
468
},
479
469
},
@@ -540,18 +530,15 @@ func TestServerUpgradeResourceState(t *testing.T) {
540
530
UpgradeStateMethod : func (ctx context.Context ) map [int64 ]resource.StateUpgrader {
541
531
return map [int64 ]resource.StateUpgrader {
542
532
0 : {
543
- PriorSchema : & tfsdk.Schema {
544
- Attributes : map [string ]tfsdk.Attribute {
545
- "id" : {
546
- Type : types .StringType ,
533
+ PriorSchema : & schema.Schema {
534
+ Attributes : map [string ]schema.Attribute {
535
+ "id" : schema.StringAttribute {
547
536
Computed : true ,
548
537
},
549
- "optional_attribute" : {
550
- Type : types .BoolType ,
538
+ "optional_attribute" : schema.BoolAttribute {
551
539
Optional : true ,
552
540
},
553
- "required_attribute" : {
554
- Type : types .BoolType ,
541
+ "required_attribute" : schema.BoolAttribute {
555
542
Required : true ,
556
543
},
557
544
},
0 commit comments