...
1
16
17 package integration
18
19 import (
20 "context"
21 "testing"
22
23 "github.com/okta/okta-sdk-golang/v2/okta/query"
24 "github.com/okta/okta-sdk-golang/v2/tests"
25
26 "github.com/stretchr/testify/assert"
27 "github.com/stretchr/testify/require"
28 )
29
30 func TestListPolicies(t *testing.T) {
31 ctx, client, err := tests.NewClient(context.TODO())
32 require.NoError(t, err)
33
34 policies, resp, err := client.Policy.ListPolicies(ctx, &query.Params{Type: "OKTA_SIGN_ON"})
35 require.NoError(t, err)
36 tests.AssertResponse(t, resp, "GET", "/api/v1/policies")
37
38 assert.True(t, len(policies) > 0, "there should be policies")
39 }
40
View as plain text