Skip to content

Commit 8cbbe5b

Browse files
committed
more green
1 parent b7eac0b commit 8cbbe5b

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

statecheck/expect_known_value_test.go

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,10 +1338,8 @@ func TestExpectKnownValue_CheckState_String(t *testing.T) {
13381338
t.Parallel()
13391339

13401340
r.Test(t, r.TestCase{
1341-
ProviderFactories: map[string]func() (*schema.Provider, error){
1342-
"test": func() (*schema.Provider, error) { //nolint:unparam // required signature
1343-
return testProvider(), nil
1344-
},
1341+
ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){
1342+
"test": providerserver.NewProviderServer(anTestProvider),
13451343
},
13461344
Steps: []r.TestStep{
13471345
{
@@ -1364,10 +1362,8 @@ func TestExpectKnownValue_CheckState_String_Custom(t *testing.T) {
13641362
t.Parallel()
13651363

13661364
r.Test(t, r.TestCase{
1367-
ProviderFactories: map[string]func() (*schema.Provider, error){
1368-
"test": func() (*schema.Provider, error) { //nolint:unparam // required signature
1369-
return testProvider(), nil
1370-
},
1365+
ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){
1366+
"test": providerserver.NewProviderServer(anTestProvider),
13711367
},
13721368
Steps: []r.TestStep{
13731369
{
@@ -1420,10 +1416,8 @@ func TestExpectKnownValue_CheckState_String_KnownValueWrongType(t *testing.T) {
14201416
t.Parallel()
14211417

14221418
r.Test(t, r.TestCase{
1423-
ProviderFactories: map[string]func() (*schema.Provider, error){
1424-
"test": func() (*schema.Provider, error) { //nolint:unparam // required signature
1425-
return testProvider(), nil
1426-
},
1419+
ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){
1420+
"test": providerserver.NewProviderServer(anTestProvider),
14271421
},
14281422
Steps: []r.TestStep{
14291423
{
@@ -1447,10 +1441,8 @@ func TestExpectKnownValue_CheckState_String_KnownValueWrongValue(t *testing.T) {
14471441
t.Parallel()
14481442

14491443
r.Test(t, r.TestCase{
1450-
ProviderFactories: map[string]func() (*schema.Provider, error){
1451-
"test": func() (*schema.Provider, error) { //nolint:unparam // required signature
1452-
return testProvider(), nil
1453-
},
1444+
ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){
1445+
"test": providerserver.NewProviderServer(anTestProvider),
14541446
},
14551447
Steps: []r.TestStep{
14561448
{

statecheck/test_provider_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ var anTestProvider = testprovider.Provider{
3232
Type: tftypes.Number,
3333
Optional: true,
3434
},
35+
{
36+
Name: "string_attribute",
37+
Type: tftypes.String,
38+
Optional: true,
39+
},
40+
{
41+
Name: "string_computed_attribute",
42+
Type: tftypes.String,
43+
Computed: true,
44+
},
3545
},
3646
},
3747
},

0 commit comments

Comments
 (0)