Skip to content

Commit b495347

Browse files
committed
green
1 parent ae8070f commit b495347

File tree

4 files changed

+17
-109
lines changed

4 files changed

+17
-109
lines changed

statecheck/expect_known_value_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,9 @@ func TestExpectKnownValue_CheckState_AttributeValueNotNull(t *testing.T) {
199199
func TestExpectKnownValue_CheckState_Bool(t *testing.T) {
200200
t.Parallel()
201201

202-
p := aTestProvider{}
203-
204202
r.Test(t, r.TestCase{
205203
ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){
206-
"test": providerserver.NewProviderServer(p),
204+
"test": providerserver.NewProviderServer(anTestProvider),
207205
},
208206
Steps: []r.TestStep{
209207
{

statecheck/test_provider.go

Whitespace-only changes.

statecheck/test_provider_test.go

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,28 @@
44
package statecheck_test
55

66
import (
7-
"context"
8-
97
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
108
"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"
1310
"github.com/hashicorp/terraform-plugin-testing/internal/testing/testsdk/resource"
1411
)
1512

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+
},
3927
},
4028
},
4129
},
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+
},
5231
}

statecheck/test_resource_test.go

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)