@@ -40,7 +40,13 @@ func TestAccGitlabProjectIssue_basic(t *testing.T) {
40
40
resource .TestCheckResourceAttr ("gitlab_project_issue.this" , "project" , testProject .PathWithNamespace ),
41
41
resource .TestCheckResourceAttr ("gitlab_project_issue.this" , "iid" , "1" ),
42
42
resource .TestCheckResourceAttr ("gitlab_project_issue.this" , "title" , "Terraform test issue" ),
43
- testCheckResourceAttrLazy ("gitlab_project_issue.this" , "created_at" , func () string { return testIssue .CreatedAt .Format (time .RFC3339 ) }),
43
+ resource .TestCheckResourceAttrWith ("gitlab_project_issue.this" , "created_at" , func (value string ) error {
44
+ expectedValue := testIssue .CreatedAt .Format (time .RFC3339 )
45
+ if value != expectedValue {
46
+ return fmt .Errorf ("should be equal to %s" , expectedValue )
47
+ }
48
+ return nil
49
+ }),
44
50
),
45
51
},
46
52
// Verify import
@@ -58,7 +64,13 @@ func TestAccGitlabProjectIssue_basic(t *testing.T) {
58
64
resource .TestCheckResourceAttr ("gitlab_project_issue.this" , "project" , testProject .PathWithNamespace ),
59
65
resource .TestCheckResourceAttr ("gitlab_project_issue.this" , "iid" , "1" ),
60
66
resource .TestCheckResourceAttr ("gitlab_project_issue.this" , "title" , "Terraform test issue" ),
61
- testCheckResourceAttrLazy ("gitlab_project_issue.this" , "updated_at" , func () string { return updatedTestIssue .UpdatedAt .Format (time .RFC3339 ) }),
67
+ resource .TestCheckResourceAttrWith ("gitlab_project_issue.this" , "updated_at" , func (value string ) error {
68
+ expectedValue := updatedTestIssue .UpdatedAt .Format (time .RFC3339 )
69
+ if value != expectedValue {
70
+ return fmt .Errorf ("should be equal to %s" , expectedValue )
71
+ }
72
+ return nil
73
+ }),
62
74
),
63
75
},
64
76
// Verify import
@@ -97,7 +109,13 @@ func TestAccGitlabProjectIssue_basic(t *testing.T) {
97
109
Check : resource .ComposeTestCheckFunc (
98
110
testAccCheckGitlabProjectIssueExists ("gitlab_project_issue.this" , & testIssue ),
99
111
resource .TestCheckResourceAttr ("gitlab_project_issue.this" , "state" , "closed" ),
100
- testCheckResourceAttrLazy ("gitlab_project_issue.this" , "closed_at" , func () string { return testIssue .ClosedAt .Format (time .RFC3339 ) }),
112
+ resource .TestCheckResourceAttrWith ("gitlab_project_issue.this" , "closed_at" , func (value string ) error {
113
+ expectedValue := testIssue .ClosedAt .Format (time .RFC3339 )
114
+ if value != expectedValue {
115
+ return fmt .Errorf ("should be equal to %s" , expectedValue )
116
+ }
117
+ return nil
118
+ }),
101
119
resource .TestCheckResourceAttr ("gitlab_project_issue.this" , "closed_by_user_id" , fmt .Sprintf ("%d" , currentUser .ID )),
102
120
),
103
121
},
0 commit comments