@@ -225,6 +225,56 @@ func TestAccArgoCDRepository_GitHubAppConsistency(t *testing.T) {
225
225
})
226
226
}
227
227
228
+ // TestAccArgoCDRepository_BearerTokenConsistency tests consistency of bearer token field
229
+ // Note: This test uses a Helm repository which doesn't require authentication but allows token auth
230
+ func TestAccArgoCDRepository_BearerTokenConsistency (t * testing.T ) {
231
+ config := `
232
+ resource "argocd_repository" "bearer_token" {
233
+ repo = "https://helm.nginx.com/stable"
234
+ type = "helm"
235
+ bearer_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30"
236
+ }
237
+ `
238
+
239
+ resource .Test (t , resource.TestCase {
240
+ PreCheck : func () { testAccPreCheck (t ) },
241
+ ProtoV6ProviderFactories : testAccProtoV6ProviderFactories ,
242
+ Steps : []resource.TestStep {
243
+ {
244
+ Config : config ,
245
+ Check : resource .ComposeAggregateTestCheckFunc (
246
+ resource .TestCheckResourceAttr (
247
+ "argocd_repository.bearer_token" ,
248
+ "bearer_token" ,
249
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30" ,
250
+ ),
251
+ resource .TestCheckResourceAttr (
252
+ "argocd_repository.bearer_token" ,
253
+ "connection_state_status" ,
254
+ "Successful" ,
255
+ ),
256
+ ),
257
+ },
258
+ {
259
+ // Apply the same configuration again to test for consistency
260
+ Config : config ,
261
+ Check : resource .ComposeAggregateTestCheckFunc (
262
+ resource .TestCheckResourceAttr (
263
+ "argocd_repository.bearer_token" ,
264
+ "bearer_token" ,
265
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30" ,
266
+ ),
267
+ resource .TestCheckResourceAttr (
268
+ "argocd_repository.bearer_token" ,
269
+ "connection_state_status" ,
270
+ "Successful" ,
271
+ ),
272
+ ),
273
+ },
274
+ },
275
+ })
276
+ }
277
+
228
278
// TestAccArgoCDRepository_UsernamePasswordConsistency tests consistency of username/password fields
229
279
// Note: This test uses a Helm repository which doesn't require authentication but allows username/password fields
230
280
func TestAccArgoCDRepository_UsernamePasswordConsistency (t * testing.T ) {
0 commit comments