Skip to content

Commit 5eb9cf1

Browse files
committed
add back changes from the pr #1334
1 parent b153f53 commit 5eb9cf1

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

stackit/internal/services/mariadb/credential/resource_test.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/google/go-cmp/cmp"
88
"github.com/hashicorp/terraform-plugin-framework/attr"
99
"github.com/hashicorp/terraform-plugin-framework/types"
10-
"github.com/stackitcloud/stackit-sdk-go/core/utils"
1110
mariadb "github.com/stackitcloud/stackit-sdk-go/services/mariadb/v1api"
1211
)
1312

@@ -59,10 +58,10 @@ func TestMapFields(t *testing.T) {
5958
"host_1",
6059
"",
6160
},
62-
Name: utils.Ptr("name"),
61+
Name: new("name"),
6362
Password: "password",
64-
Port: utils.Ptr(int32(1234)),
65-
Uri: utils.Ptr("uri"),
63+
Port: new(int32(1234)),
64+
Uri: new("uri"),
6665
Username: "username",
6766
},
6867
},
@@ -106,10 +105,10 @@ func TestMapFields(t *testing.T) {
106105
"host_1",
107106
"host_2",
108107
},
109-
Name: utils.Ptr("name"),
108+
Name: new("name"),
110109
Password: "password",
111-
Port: utils.Ptr(int32(1234)),
112-
Uri: utils.Ptr("uri"),
110+
Port: new(int32(1234)),
111+
Uri: new("uri"),
113112
Username: "username",
114113
},
115114
},
@@ -147,7 +146,7 @@ func TestMapFields(t *testing.T) {
147146
Hosts: []string{},
148147
Name: nil,
149148
Password: "",
150-
Port: utils.Ptr(int32(2123456789)),
149+
Port: new(int32(2123456789)),
151150
Uri: nil,
152151
Username: "",
153152
},

stackit/internal/services/mariadb/instance/resource_test.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/hashicorp/terraform-plugin-framework/attr"
99
"github.com/hashicorp/terraform-plugin-framework/types"
1010
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
11-
"github.com/stackitcloud/stackit-sdk-go/core/utils"
1211
mariadb "github.com/stackitcloud/stackit-sdk-go/services/mariadb/v1api"
1312
)
1413

@@ -38,13 +37,13 @@ var fixtureNullModelParameters = types.ObjectValueMust(parametersTypes, map[stri
3837
})
3938

4039
var fixtureInstanceParameters = mariadb.InstanceParameters{
41-
SgwAcl: utils.Ptr("acl"),
42-
EnableMonitoring: utils.Ptr(true),
43-
Graphite: utils.Ptr("graphite"),
44-
MaxDiskThreshold: utils.Ptr(int32(10)),
45-
MetricsFrequency: utils.Ptr(int32(10)),
46-
MetricsPrefix: utils.Ptr("prefix"),
47-
MonitoringInstanceId: utils.Ptr("mid"),
40+
SgwAcl: new("acl"),
41+
EnableMonitoring: new(true),
42+
Graphite: new("graphite"),
43+
MaxDiskThreshold: new(int32(10)),
44+
MetricsFrequency: new(int32(10)),
45+
MetricsPrefix: new("prefix"),
46+
MonitoringInstanceId: new("mid"),
4847
Syslog: []string{"syslog", "syslog2"},
4948
}
5049

@@ -81,10 +80,10 @@ func TestMapFields(t *testing.T) {
8180
CfSpaceGuid: "space",
8281
DashboardUrl: "dashboard",
8382
ImageUrl: "image",
84-
InstanceId: utils.Ptr("iid"),
83+
InstanceId: new("iid"),
8584
Name: "name",
8685
CfOrganizationGuid: "org",
87-
Parameters: map[string]interface{}{
86+
Parameters: map[string]any{
8887
"sgw_acl": "acl",
8988
"enable_monitoring": true,
9089
"graphite": "graphite",
@@ -125,7 +124,7 @@ func TestMapFields(t *testing.T) {
125124
{
126125
"wrong_param_types_1",
127126
&mariadb.Instance{
128-
Parameters: map[string]interface{}{
127+
Parameters: map[string]any{
129128
"sgw_acl": true,
130129
},
131130
},
@@ -135,7 +134,7 @@ func TestMapFields(t *testing.T) {
135134
{
136135
"wrong_param_types_2",
137136
&mariadb.Instance{
138-
Parameters: map[string]interface{}{
137+
Parameters: map[string]any{
139138
"sgw_acl": 1,
140139
},
141140
},

0 commit comments

Comments
 (0)