@@ -18,6 +18,7 @@ package integration
1818
1919import (
2020 "context"
21+ "encoding/json"
2122 "net/http"
2223 "testing"
2324 "time"
@@ -29,7 +30,7 @@ import (
2930 "github.com/stretchr/testify/require"
3031)
3132
32- func Test_can_get_a_group (t * testing.T ) {
33+ func TestCanGetAGroup (t * testing.T ) {
3334 ctx , client , err := tests .NewClient (context .TODO ())
3435 require .NoError (t , err )
3536 // Create a new group → POST /api/v1/groups
@@ -59,7 +60,7 @@ func Test_can_get_a_group(t *testing.T) {
5960 "Should have resulted in a 404 when finding a deleted group" )
6061}
6162
62- func Test_can_list_groups (t * testing.T ) {
63+ func TestCanListGroups (t * testing.T ) {
6364 ctx , client , err := tests .NewClient (context .TODO ())
6465 require .NoError (t , err )
6566 // Create a new group → POST /api/v1/groups
@@ -89,7 +90,7 @@ func Test_can_list_groups(t *testing.T) {
8990 require .NoError (t , err , "Should not error when deleting a group" )
9091}
9192
92- func Test_can_search_for_a_group (t * testing.T ) {
93+ func TestCanSearchForAGroup (t * testing.T ) {
9394 ctx , client , err := tests .NewClient (context .TODO ())
9495 require .NoError (t , err )
9596 // Create a new group → POST /api/v1/groups
@@ -121,7 +122,7 @@ func Test_can_search_for_a_group(t *testing.T) {
121122 require .NoError (t , err , "Should not error when deleting a group" )
122123}
123124
124- func Test_can_update_a_group (t * testing.T ) {
125+ func TestCanUpdateAGroup (t * testing.T ) {
125126 ctx , client , err := tests .NewClient (context .TODO ())
126127 require .NoError (t , err )
127128 // Create a new group → POST /api/v1/groups
@@ -153,7 +154,7 @@ func Test_can_update_a_group(t *testing.T) {
153154 require .NoError (t , err , "Should not error when deleting a group" )
154155}
155156
156- func Test_group_user_operations (t * testing.T ) {
157+ func TestGroupUserOperations (t * testing.T ) {
157158 ctx , client , err := tests .NewClient (context .TODO ())
158159 require .NoError (t , err )
159160 // Create a user with credentials → POST /api/v1/users?activate=false
@@ -218,7 +219,7 @@ func Test_group_user_operations(t *testing.T) {
218219 require .NoError (t , err , "Should not error when deleting a group" )
219220}
220221
221- func Test_group_rule_operations (t * testing.T ) {
222+ func TestGroupRuleOperations (t * testing.T ) {
222223 t .Skip ("does not work properly in test org" )
223224 ctx , client , err := tests .NewClient (context .TODO (), okta .WithCache (false ))
224225 // Create a user with credentials, activated by default → POST /api/v1/users?activate=true
@@ -364,3 +365,30 @@ func Test_group_rule_operations(t *testing.T) {
364365 _ , err = client .Group .DeleteGroupRule (ctx , groupRule .Id , & query.Params {})
365366 require .NoError (t , err , "Should not error when deleting Rule" )
366367}
368+
369+ func TestGroupProfileSerialization (t * testing.T ) {
370+ gp := okta.GroupProfile {
371+ Name : "test" ,
372+ Description : "tester" ,
373+ GroupProfileMap : okta.GroupProfileMap {
374+ "custom" : "value" ,
375+ },
376+ }
377+
378+ gpExpected := okta.GroupProfile {
379+ Name : "test" ,
380+ Description : "tester" ,
381+ GroupProfileMap : okta.GroupProfileMap {
382+ "custom" : "value" ,
383+ },
384+ }
385+
386+ b , err := json .Marshal (& gp )
387+ require .NoError (t , err )
388+
389+ var gpCopy okta.GroupProfile
390+ err = json .Unmarshal (b , & gpCopy )
391+ require .NoError (t , err )
392+
393+ assert .Equal (t , gpExpected , gpCopy , "expected marshal to unmarshal to produce exact copy of group profile" )
394+ }
0 commit comments