Skip to content

Commit 135ee76

Browse files
Merge pull request #401 from okta/update-spec
update spec and test
2 parents 97060b6 + 4013bd3 commit 135ee76

9 files changed

Lines changed: 10782 additions & 4573 deletions

.generator/okta-management-APIs-oasv3-enum-inheritance.yaml

Lines changed: 10718 additions & 4530 deletions
Large diffs are not rendered by default.

.generator/templates/api_application_test.go

Lines changed: 30 additions & 30 deletions
Large diffs are not rendered by default.

.generator/templates/api_group_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func Test_List_Assigned_Applications_For_Group(t *testing.T) {
217217
assert.Equal(t, 0, len(apps), "there shouldn't be any apps assigned to group")
218218
createdApp, _, err = setupBookmarkApplication(randomTestString())
219219
require.NoError(t, err, "Creating an application should not error")
220-
aareq := apiClient.ApplicationApi.AssignGroupToApplication(apiClient.cfg.Context, createdApp.BookmarkApplication.GetId(), group.GetId())
220+
aareq := apiClient.ApplicationGroupsApi.AssignGroupToApplication(apiClient.cfg.Context, createdApp.BookmarkApplication.GetId(), group.GetId())
221221
aareq.applicationGroupAssignment = NewApplicationGroupAssignment()
222222
_, _, err = aareq.Execute()
223223
require.NoError(t, err, "Assigning application to group should not error")

.generator/templates/api_idp_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,12 @@ func Test_Get_Linked_User(t *testing.T) {
212212
require.NoError(t, err, "Could not get user's idp")
213213
assert.Equal(t, createdUser.GetId(), linkUser.GetId())
214214
var idpInLink bool
215-
if idp, ok := linkUser.Links["idp"]; ok {
216-
if href, ok := idp["href"]; ok {
217-
if strings.Contains(fmt.Sprintf("%v", href), createdIdp.GetId()) {
218-
idpInLink = true
215+
if idp, ok := linkUser.Links.AdditionalProperties["idp"]; ok {
216+
if hrefMap, ok := idp.(map[string]interface{}); ok {
217+
if href, ok := hrefMap["href"]; ok {
218+
if strings.Contains(fmt.Sprintf("%v", href), createdIdp.GetId()) {
219+
idpInLink = true
220+
}
219221
}
220222
}
221223
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
{{#appName}}
3+
{{{.}}}
4+
{{/appName}}
5+
6+
Testing {{classname}}Service
7+
8+
*/
9+
10+
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
11+
// These test need to be empty because of non native (enum) type our sdk have
12+
package {{packageName}}

.generator/templates/api_user_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,14 @@ func Test_List_User_Subscriptions(t *testing.T) {
342342
user, _, err := apiClient.UserApi.GetUser(apiClient.cfg.Context, "me").Execute()
343343
require.NoError(t, err, "Getting the current user should not error")
344344
t.Run("get user subscription", func(t *testing.T) {
345-
subscriptions, _, err := apiClient.SubscriptionApi.ListUserSubscriptions(apiClient.cfg.Context, user.GetId()).Execute()
345+
subscriptions, _, err := apiClient.SubscriptionApi.ListSubscriptionsUser(apiClient.cfg.Context, user.GetId()).Execute()
346346
require.NoError(t, err, "Should not error listing user subscriptions")
347347
assert.True(t, len(subscriptions) > 0, "User should have subscriptions")
348348
})
349349
t.Run("get user subscription by notification type", func(t *testing.T) {
350-
expectedNotificationType := "OKTA_ANNOUNCEMENT"
351-
subscription, _, err := apiClient.SubscriptionApi.ListUserSubscriptionsByNotificationType(apiClient.cfg.Context, user.GetId(), expectedNotificationType).Execute()
350+
subscription, _, err := apiClient.SubscriptionApi.GetSubscriptionsNotificationTypeUser(apiClient.cfg.Context, NOTIFICATIONTYPE_OKTA_ANNOUNCEMENT, user.GetId()).Execute()
352351
require.NoError(t, err, "Should not error getting user subscription by notification types")
353-
assert.Equal(t, subscription.GetNotificationType(), NOTIFICATIONTYPE_OKTA_ANNOUNCEMENT, "User should have subscription notification type %q, got %q", expectedNotificationType, subscription.NotificationType)
352+
assert.Equal(t, subscription.GetNotificationType(), NOTIFICATIONTYPE_OKTA_ANNOUNCEMENT, "User should have subscription notification type %q, got %q", NOTIFICATIONTYPE_OKTA_ANNOUNCEMENT, subscription.NotificationType)
354353
})
355354
}
356355

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}/{{versionName}}
22

3-
go 1.13
3+
go 1.20
44

55
require (
66
{{#withAWSV4Signature}}
77
github.com/aws/aws-sdk-go v1.34.14
88
{{/withAWSV4Signature}}
99
github.com/cenkalti/backoff/v4 v4.1.3
1010
github.com/go-jose/go-jose/v3 v3.0.0
11-
github.com/davecgh/go-spew v1.1.1 // indirect
1211
github.com/jarcoal/httpmock v1.2.0
1312
github.com/kelseyhightower/envconfig v1.4.0
1413
github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627
1514
github.com/stretchr/testify v1.7.1
1615
golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558
1716
gopkg.in/yaml.v3 v3.0.1
1817
)
18+
19+
require (
20+
github.com/davecgh/go-spew v1.1.1 // indirect
21+
github.com/golang/protobuf v1.4.2 // indirect
22+
github.com/pmezard/go-difflib v1.0.0 // indirect
23+
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
24+
golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect
25+
google.golang.org/appengine v1.6.6 // indirect
26+
google.golang.org/protobuf v1.25.0 // indirect
27+
)
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
116116
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
117117
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
118118
github.com/maxatome/go-testdeep v1.11.0 h1:Tgh5efyCYyJFGUYiT0qxBSIDeXw0F5zSoatlou685kk=
119-
github.com/maxatome/go-testdeep v1.11.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
120119
github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627 h1:pSCLCl6joCFRnjpeojzOpEYs4q7Vditq8fySFG5ap3Y=
121120
github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
122121
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=

.github/workflows/prepareReleaseBranch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Install openapi generator
3838
run: npm install @openapitools/openapi-generator-cli -g
3939
- name: Set openapi generator version
40-
run: openapi-generator-cli version-manager set 6.0.1
40+
run: openapi-generator-cli version-manager set 6.6.0
4141
- name: Generate go client
4242
run: make v3-generate
4343
- run: make fmt

0 commit comments

Comments
 (0)