|
4 | 4 | package statecheck_test |
5 | 5 |
|
6 | 6 | import ( |
7 | | - "context" |
8 | | - |
9 | 7 | "github.com/hashicorp/terraform-plugin-go/tfprotov6" |
10 | 8 | "github.com/hashicorp/terraform-plugin-go/tftypes" |
11 | | - "github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/datasource" |
12 | | - "github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/provider" |
| 9 | + "github.com/hashicorp/terraform-plugin-testing/internal/testing/testprovider" |
13 | 10 | "github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/resource" |
14 | 11 | ) |
15 | 12 |
|
16 | | -type aTestProvider struct { |
17 | | -} |
18 | | - |
19 | | -func (t aTestProvider) Configure(ctx context.Context, request provider.ConfigureRequest, response *provider.ConfigureResponse) { |
20 | | -} |
21 | | - |
22 | | -func (t aTestProvider) DataSourcesMap() map[string]datasource.DataSource { |
23 | | - return nil |
24 | | -} |
25 | | - |
26 | | -func (t aTestProvider) ResourcesMap() map[string]resource.Resource { |
27 | | - return map[string]resource.Resource{ |
28 | | - "test_resource": &aTestResource{}, |
29 | | - } |
30 | | -} |
31 | | - |
32 | | -func (t aTestProvider) Schema(ctx context.Context, request provider.SchemaRequest, response *provider.SchemaResponse) { |
33 | | - schema := tfprotov6.Schema{ |
34 | | - Block: &tfprotov6.SchemaBlock{ |
35 | | - Attributes: []*tfprotov6.SchemaAttribute{ |
36 | | - { |
37 | | - Name: "planet", |
38 | | - Type: tftypes.String, |
| 13 | +var anTestProvider = testprovider.Provider{ |
| 14 | + Resources: map[string]testprovider.Resource{ |
| 15 | + "test_resource": { |
| 16 | + SchemaResponse: &resource.SchemaResponse{ |
| 17 | + Schema: &tfprotov6.Schema{ |
| 18 | + Block: &tfprotov6.SchemaBlock{ |
| 19 | + Attributes: []*tfprotov6.SchemaAttribute{ |
| 20 | + { |
| 21 | + Name: "bool_attribute", |
| 22 | + Type: tftypes.Bool, |
| 23 | + Computed: true, |
| 24 | + }, |
| 25 | + }, |
| 26 | + }, |
39 | 27 | }, |
40 | 28 | }, |
41 | 29 | }, |
42 | | - } |
43 | | - response.Schema = &schema |
44 | | -} |
45 | | - |
46 | | -func (t aTestProvider) Stop(ctx context.Context, request provider.StopRequest, response *provider.StopResponse) { |
47 | | - //TODO implement me |
48 | | - panic("implement me") |
49 | | -} |
50 | | - |
51 | | -func (t aTestProvider) ValidateConfig(ctx context.Context, request provider.ValidateConfigRequest, response *provider.ValidateConfigResponse) { |
| 30 | + }, |
52 | 31 | } |
0 commit comments