Skip to content

Commit

Permalink
Merge pull request #365 from okta/clean-up
Browse files Browse the repository at this point in the history
add clean up for clone policy
  • Loading branch information
duytiennguyen-okta authored Feb 8, 2023
2 parents 9383ac5 + 26c488a commit 3bb2eb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .generator/templates/api_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,20 @@ func Test_Activate_Policy(t *testing.T) {
func Test_Clone_Policy(t *testing.T) {
createdPolicy, _, err := setupAccessPolicy(randomTestString())
require.NoError(t, err, "Creating a new policy should not error")
var policyID string
t.Run("clone policy", func(t *testing.T) {
policy, _, err := apiClient.PolicyApi.ClonePolicy(apiClient.cfg.Context, createdPolicy.AccessPolicy.GetId()).Execute()
require.NoError(t, err, "Could not get policy by ID")
policyID = policy.AccessPolicy.GetId()
assert.NotEqual(t, createdPolicy.AccessPolicy.GetId(), policy.AccessPolicy.GetId())
assert.Equal(t, fmt.Sprintf("[cloned] %v", createdPolicy.AccessPolicy.GetName()), policy.AccessPolicy.GetName())
assert.Equal(t, createdPolicy.AccessPolicy.GetDescription(), policy.AccessPolicy.GetDescription())
assert.Equal(t, createdPolicy.AccessPolicy.GetPriority(), policy.AccessPolicy.GetPriority())
})
err = cleanUpPolicy(createdPolicy.AccessPolicy.GetId())
require.NoError(t, err, "Clean up policy should not error")
err = cleanUpPolicy(policyID)
require.NoError(t, err, "Clean up policy should not error")
}

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

0 comments on commit 3bb2eb5

Please sign in to comment.