...

Source file src/github.com/okta/okta-sdk-golang/v2/tests/integration/policies_test.go

Documentation: github.com/okta/okta-sdk-golang/v2/tests/integration

     1  /*
     2   * Copyright 2018 - Present Okta, Inc.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *      http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    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