@@ -5,54 +5,65 @@ package statecheck_test
55
66import (
77 "context"
8+
9+ "github.com/hashicorp/terraform-plugin-go/tfprotov6"
10+ "github.com/hashicorp/terraform-plugin-go/tftypes"
811 "github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/resource"
912)
1013
11- type testResource struct {}
14+ type aTestResource struct {}
1215
13- func (t testResource ) Create (ctx context.Context , request resource.CreateRequest , response * resource.CreateResponse ) {
16+ func (t aTestResource ) Create (ctx context.Context , request resource.CreateRequest , response * resource.CreateResponse ) {
1417 //TODO implement me
1518 panic ("implement me" )
1619}
1720
18- func (t testResource ) Delete (ctx context.Context , request resource.DeleteRequest , response * resource.DeleteResponse ) {
21+ func (t aTestResource ) Delete (ctx context.Context , request resource.DeleteRequest , response * resource.DeleteResponse ) {
1922 //TODO implement me
2023 panic ("implement me" )
2124}
2225
23- func (t testResource ) ImportState (ctx context.Context , request resource.ImportStateRequest , response * resource.ImportStateResponse ) {
26+ func (t aTestResource ) ImportState (ctx context.Context , request resource.ImportStateRequest , response * resource.ImportStateResponse ) {
2427 //TODO implement me
2528 panic ("implement me" )
2629}
2730
28- func (t testResource ) PlanChange (ctx context.Context , request resource.PlanChangeRequest , response * resource.PlanChangeResponse ) {
31+ func (t aTestResource ) PlanChange (ctx context.Context , request resource.PlanChangeRequest , response * resource.PlanChangeResponse ) {
2932 //TODO implement me
3033 panic ("implement me" )
3134}
3235
33- func (t testResource ) Read (ctx context.Context , request resource.ReadRequest , response * resource.ReadResponse ) {
36+ func (t aTestResource ) Read (ctx context.Context , request resource.ReadRequest , response * resource.ReadResponse ) {
3437 //TODO implement me
3538 panic ("implement me" )
3639}
3740
38- func (t testResource ) Schema (ctx context.Context , request resource.SchemaRequest , response * resource.SchemaResponse ) {
39- //TODO implement me
40- panic ("implement me" )
41+ func (t aTestResource ) Schema (ctx context.Context , request resource.SchemaRequest , response * resource.SchemaResponse ) {
42+ schema := tfprotov6.Schema {
43+ Block : & tfprotov6.SchemaBlock {
44+ Attributes : []* tfprotov6.SchemaAttribute {
45+ {
46+ Name : "bool_attribute" ,
47+ Type : tftypes .Bool ,
48+ Computed : true ,
49+ },
50+ },
51+ Description : "" ,
52+ DescriptionKind : 0 ,
53+ },
54+ }
55+ response .Schema = & schema
4156}
4257
43- func (t testResource ) Update (ctx context.Context , request resource.UpdateRequest , response * resource.UpdateResponse ) {
58+ func (t aTestResource ) Update (ctx context.Context , request resource.UpdateRequest , response * resource.UpdateResponse ) {
4459 //TODO implement me
4560 panic ("implement me" )
4661}
4762
48- func (t testResource ) UpgradeState (ctx context.Context , request resource.UpgradeStateRequest , response * resource.UpgradeStateResponse ) {
63+ func (t aTestResource ) UpgradeState (ctx context.Context , request resource.UpgradeStateRequest , response * resource.UpgradeStateResponse ) {
4964 //TODO implement me
5065 panic ("implement me" )
5166}
5267
53- func (t testResource ) ValidateConfig (ctx context.Context , request resource.ValidateConfigRequest , response * resource.ValidateConfigResponse ) {
54- //TODO implement me
55- panic ("implement me" )
68+ func (t aTestResource ) ValidateConfig (ctx context.Context , request resource.ValidateConfigRequest , response * resource.ValidateConfigResponse ) {
5669}
57-
58-
0 commit comments