Skip to content

Commit

Permalink
Add test execution
Browse files Browse the repository at this point in the history
  • Loading branch information
akhter-ali-idexx committed Oct 9, 2024
1 parent c74d1bf commit ad7d6aa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/platform/resource_oidc_identity_mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,26 @@ func TestAccOIDCIdentityMapping_roles_scope(t *testing.T) {
"scope": "applied-permissions/roles:myProject:\"developer\",\"qa\"",
}

config := util.ExecuteTemplate(identityMappingName, temp, testData)

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProviders(),
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(fqrn, "name", testData["identityMappingName"]),
resource.TestCheckResourceAttr(fqrn, "priority", testData["priority"]),
resource.TestCheckResourceAttr(fqrn, "claims_json", fmt.Sprintf("{\"sub\":\"%s\",\"updated_at\":1490198843}", testData["sub"])),
resource.TestCheckResourceAttr(fqrn, "token_spec.scope", "applied-permissions/roles:myProject:\"developer\",\"qa\""),
resource.TestCheckResourceAttr(fqrn, "token_spec.audience", "*@*"),
resource.TestCheckResourceAttr(fqrn, "token_spec.expires_in", "120"),
),
},
},
})

}

func TestAccOIDCIdentityMapping_groups_scope(t *testing.T) {
Expand Down

0 comments on commit ad7d6aa

Please sign in to comment.