@@ -52,33 +52,31 @@ var (
52
52
when {
53
53
context.project.ipAccessList.contains(ip("0.0.0.0/0"))
54
54
};`
55
- descriptionPtr = conversion . StringPtr ( "test-description" )
55
+ description = "test-description"
56
56
)
57
57
58
58
func TestAccResourcePolicy_basic (t * testing.T ) {
59
- tc := basicTestCase (t , descriptionPtr )
59
+ tc := basicTestCase (t )
60
60
resource .Test (t , * tc )
61
61
}
62
62
63
- func basicTestCase (t * testing.T , description * string ) * resource.TestCase {
63
+ func basicTestCase (t * testing.T ) * resource.TestCase {
64
64
t .Helper ()
65
65
var (
66
66
orgID = os .Getenv ("MONGODB_ATLAS_ORG_ID" )
67
67
policyName = "test-policy"
68
68
updatedName = "updated-policy"
69
69
)
70
- var updatedDescription string
71
- if description != nil {
72
- updatedDescription = fmt .Sprintf ("updated-%s" , * description )
73
- }
70
+ updatedDescription := fmt .Sprintf ("updated-%s" , description )
71
+
74
72
return & resource.TestCase { // Need sequential execution for assertions to be deterministic (plural data source)
75
73
PreCheck : func () { acc .PreCheckBasic (t ) },
76
74
ProtoV6ProviderFactories : acc .TestAccProviderV6Factories ,
77
75
CheckDestroy : checkDestroy ,
78
76
Steps : []resource.TestStep {
79
77
{
80
- Config : configBasic (orgID , policyName , description ),
81
- Check : checksResourcePolicy (orgID , policyName , description , 1 ),
78
+ Config : configBasic (orgID , policyName , & description ),
79
+ Check : checksResourcePolicy (orgID , policyName , & description , 1 ),
82
80
},
83
81
{
84
82
Config : configBasic (orgID , updatedName , nil ),
0 commit comments