@@ -100,20 +100,20 @@ func TestAccClientZeroValueCheck(t *testing.T) {
100100 },
101101 Steps : []resource.TestStep {
102102 {
103- Config : testAccClientConfig_create ,
103+ Config : testAccClientConfigCreate ,
104104 Check : resource .ComposeTestCheckFunc (
105105 resource .TestCheckResourceAttr ("auth0_client.my_client" , "name" , "Application - Acceptance Test - Zero Value Check" ),
106106 resource .TestCheckResourceAttr ("auth0_client.my_client" , "is_first_party" , "false" ),
107107 ),
108108 },
109109 {
110- Config : testAccClientConfig_update ,
110+ Config : testAccClientConfigUpdate ,
111111 Check : resource .ComposeTestCheckFunc (
112112 resource .TestCheckResourceAttr ("auth0_client.my_client" , "is_first_party" , "true" ),
113113 ),
114114 },
115115 {
116- Config : testAccClientConfig_update_again ,
116+ Config : testAccClientConfigUpdateAgain ,
117117 Check : resource .ComposeTestCheckFunc (
118118 resource .TestCheckResourceAttr ("auth0_client.my_client" , "is_first_party" , "false" ),
119119 ),
@@ -122,23 +122,63 @@ func TestAccClientZeroValueCheck(t *testing.T) {
122122 })
123123}
124124
125- const testAccClientConfig_create = `
125+ const testAccClientConfigCreate = `
126126resource "auth0_client" "my_client" {
127127 name = "Application - Acceptance Test - Zero Value Check"
128128 is_first_party = false
129129}
130130`
131131
132- const testAccClientConfig_update = `
132+ const testAccClientConfigUpdate = `
133133resource "auth0_client" "my_client" {
134134 name = "Application - Acceptance Test - Zero Value Check"
135135 is_first_party = true
136136}
137137`
138138
139- const testAccClientConfig_update_again = `
139+ const testAccClientConfigUpdateAgain = `
140140resource "auth0_client" "my_client" {
141141 name = "Application - Acceptance Test - Zero Value Check"
142142 is_first_party = false
143143}
144144`
145+
146+ func TestAccClientRotateSecret (t * testing.T ) {
147+
148+ resource .Test (t , resource.TestCase {
149+ Providers : map [string ]terraform.ResourceProvider {
150+ "auth0" : Provider (),
151+ },
152+ Steps : []resource.TestStep {
153+ {
154+ Config : testAccClientConfigRotateSecret ,
155+ Check : resource .ComposeTestCheckFunc (
156+ resource .TestCheckResourceAttr ("auth0_client.my_client" , "name" , "Application - Acceptance Test - Rotate Secret" ),
157+ ),
158+ },
159+ {
160+ Config : testAccClientConfigRotateSecretUpdate ,
161+ Check : resource .ComposeTestCheckFunc (
162+ resource .TestCheckResourceAttr ("auth0_client.my_client" , "client_secret_rotation_trigger.triggered_at" , "2018-01-02T23:12:01Z" ),
163+ resource .TestCheckResourceAttr ("auth0_client.my_client" , "client_secret_rotation_trigger.triggered_by" , "alex" ),
164+ ),
165+ },
166+ },
167+ })
168+ }
169+
170+ const testAccClientConfigRotateSecret = `
171+ resource "auth0_client" "my_client" {
172+ name = "Application - Acceptance Test - Rotate Secret"
173+ }
174+ `
175+
176+ const testAccClientConfigRotateSecretUpdate = `
177+ resource "auth0_client" "my_client" {
178+ name = "Application - Acceptance Test - Rotate Secret"
179+ client_secret_rotation_trigger = {
180+ triggered_at = "2018-01-02T23:12:01Z"
181+ triggered_by = "alex"
182+ }
183+ }
184+ `
0 commit comments