Skip to content

Commit

Permalink
removed include
Browse files Browse the repository at this point in the history
  • Loading branch information
netramali committed Nov 8, 2023
1 parent 9095190 commit 56ea352
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 0 additions & 2 deletions oauth_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ type OAuthClientIncludeOpt string

const (
OauthClientOauthTokens OAuthClientIncludeOpt = "oauth_tokens"
// OauthClientProjects field is still in BETA and subject to change.**
OauthClientProjects OAuthClientIncludeOpt = "projects"
)

// OAuthClientListOptions represents the options for listing
Expand Down
18 changes: 1 addition & 17 deletions oauth_client_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ func TestOAuthClientsList(t *testing.T) {
ocTest2, ocTestCleanup2 := createOAuthClient(t, client, orgTest, nil)
defer ocTestCleanup2()

project, projectCleanup := createProject(t, client, orgTest)
defer projectCleanup()

t.Run("without list options", func(t *testing.T) {
ocl, err := client.OAuthClients.List(ctx, orgTest.Name, nil)
require.NoError(t, err)
Expand Down Expand Up @@ -73,7 +70,7 @@ func TestOAuthClientsList(t *testing.T) {

t.Run("with Include options", func(t *testing.T) {
ocl, err := client.OAuthClients.List(ctx, orgTest.Name, &OAuthClientListOptions{
Include: []OAuthClientIncludeOpt{OauthClientOauthTokens, OauthClientProjects},
Include: []OAuthClientIncludeOpt{OauthClientOauthTokens},
})
require.NoError(t, err)
require.NotEmpty(t, ocl.Items)
Expand All @@ -82,19 +79,6 @@ func TestOAuthClientsList(t *testing.T) {
assert.NotEmpty(t, ocl.Items[0].OAuthTokens[0].ID)
})

t.Run("with project include options", func(t *testing.T) {
psl, err := client.OAuthClients.List(ctx, orgTest.Name, &OAuthClientListOptions{
Include: []OAuthClientIncludeOpt{OauthClientProjects},
})
require.NoError(t, err)
assert.Equal(t, 2, len(psl.Items))

assert.NotNil(t, psl.Items[0].Projects)
assert.Equal(t, 1, len(psl.Items[0].Projects))
assert.Equal(t, project.ID, psl.Items[0].Projects[0].ID)
assert.Equal(t, project.Name, psl.Items[0].Projects[0].Name)
})

t.Run("without a valid organization", func(t *testing.T) {
ocl, err := client.OAuthClients.List(ctx, badIdentifier, nil)
assert.Nil(t, ocl)
Expand Down

0 comments on commit 56ea352

Please sign in to comment.