Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: Tien Nguyen <duytien.nguyen@okta.com>
  • Loading branch information
duytiennguyen-okta committed Oct 31, 2024
1 parent 21fdc3f commit f787da6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions okta/resource_okta_app_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ other arguments that changed will be applied.`,
Type: schema.TypeString,
},
Optional: true,
Computed: true,
Description: "List of OAuth 2.0 response type strings.",
},
"grant_types": {
Expand All @@ -264,6 +265,7 @@ other arguments that changed will be applied.`,
Type: schema.TypeString,
},
Optional: true,
Computed: true,
Description: "List of OAuth 2.0 grant types. Conditional validation params found here https://developer.okta.com/docs/api/resources/apps#credentials-settings-details. Defaults to minimum requirements per app type.",
},
"tos_uri": {
Expand Down
31 changes: 31 additions & 0 deletions okta/resource_okta_app_oauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,3 +907,34 @@ func TestAccResourceOktaAppOauth_omitSecretSafeEnable(t *testing.T) {
},
})
}

func TestAccResourceOktaAppOauth_1952(t *testing.T) {
mgr := newFixtureManager("resources", appOAuth, t.Name())
resourceName := fmt.Sprintf("%s.test", appOAuth)
config := `
resource "okta_app_oauth" "test" {
label = "MyApp"
type = "web"
redirect_uris = ["http://d.com/"]
hide_ios = true
hide_web = true
omit_secret = true
}
`
oktaResourceTest(t, resource.TestCase{
PreCheck: testAccPreCheck(t),
ErrorCheck: testAccErrorChecks(t),
ProviderFactories: testAccProvidersFactories,
CheckDestroy: checkResourceDestroy(appOAuth, createDoesAppExist(sdk.NewOpenIdConnectApplication())),
Steps: []resource.TestStep{
{
Config: mgr.ConfigReplace(config),
Check: resource.ComposeTestCheckFunc(
ensureResourceExists(resourceName, createDoesAppExist(sdk.NewAutoLoginApplication())),
resource.TestCheckResourceAttr(resourceName, "grant_types.#", "1"),
resource.TestCheckResourceAttr(resourceName, "grant_types.0", "authorization_code"),
),
},
},
})
}

0 comments on commit f787da6

Please sign in to comment.