@@ -40,23 +40,23 @@ func TestDefaultAccountManager_CreateGroup(t *testing.T) {
4040 }
4141 for _ , group := range account .Groups {
4242 group .Issued = types .GroupIssuedIntegration
43- err = am .SaveGroup (context .Background (), account .Id , groupAdminUserID , group )
43+ err = am .SaveGroup (context .Background (), account .Id , groupAdminUserID , group , true )
4444 if err != nil {
4545 t .Errorf ("should allow to create %s groups" , types .GroupIssuedIntegration )
4646 }
4747 }
4848
4949 for _ , group := range account .Groups {
5050 group .Issued = types .GroupIssuedJWT
51- err = am .SaveGroup (context .Background (), account .Id , groupAdminUserID , group )
51+ err = am .SaveGroup (context .Background (), account .Id , groupAdminUserID , group , true )
5252 if err != nil {
5353 t .Errorf ("should allow to create %s groups" , types .GroupIssuedJWT )
5454 }
5555 }
5656 for _ , group := range account .Groups {
5757 group .Issued = types .GroupIssuedAPI
5858 group .ID = ""
59- err = am .SaveGroup (context .Background (), account .Id , groupAdminUserID , group )
59+ err = am .SaveGroup (context .Background (), account .Id , groupAdminUserID , group , true )
6060 if err == nil {
6161 t .Errorf ("should not create api group with the same name, %s" , group .Name )
6262 }
@@ -162,7 +162,7 @@ func TestDefaultAccountManager_DeleteGroups(t *testing.T) {
162162 }
163163 }
164164
165- err = manager .SaveGroups (context .Background (), account .Id , groupAdminUserID , groups )
165+ err = manager .SaveGroups (context .Background (), account .Id , groupAdminUserID , groups , true )
166166 assert .NoError (t , err , "Failed to save test groups" )
167167
168168 testCases := []struct {
@@ -382,13 +382,13 @@ func initTestGroupAccount(am *DefaultAccountManager) (*DefaultAccountManager, *t
382382 return nil , nil , err
383383 }
384384
385- _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForRoute )
386- _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForRoute2 )
387- _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForNameServerGroups )
388- _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForPolicies )
389- _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForSetupKeys )
390- _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForUsers )
391- _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForIntegration )
385+ _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForRoute , true )
386+ _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForRoute2 , true )
387+ _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForNameServerGroups , true )
388+ _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForPolicies , true )
389+ _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForSetupKeys , true )
390+ _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForUsers , true )
391+ _ = am .SaveGroup (context .Background (), accountID , groupAdminUserID , groupForIntegration , true )
392392
393393 acc , err := am .Store .GetAccount (context .Background (), account .Id )
394394 if err != nil {
@@ -426,7 +426,7 @@ func TestGroupAccountPeersUpdate(t *testing.T) {
426426 Name : "GroupE" ,
427427 Peers : []string {peer2 .ID },
428428 },
429- })
429+ }, true )
430430 assert .NoError (t , err )
431431
432432 updMsg := manager .peersUpdateManager .CreateChannel (context .Background (), peer1 .ID )
@@ -446,7 +446,7 @@ func TestGroupAccountPeersUpdate(t *testing.T) {
446446 ID : "groupB" ,
447447 Name : "GroupB" ,
448448 Peers : []string {peer1 .ID , peer2 .ID },
449- })
449+ }, true )
450450 assert .NoError (t , err )
451451
452452 select {
@@ -524,7 +524,7 @@ func TestGroupAccountPeersUpdate(t *testing.T) {
524524 Action : types .PolicyTrafficActionAccept ,
525525 },
526526 },
527- })
527+ }, true )
528528 assert .NoError (t , err )
529529
530530 // Saving a group linked to policy should update account peers and send peer update
@@ -539,7 +539,7 @@ func TestGroupAccountPeersUpdate(t *testing.T) {
539539 ID : "groupA" ,
540540 Name : "GroupA" ,
541541 Peers : []string {peer1 .ID , peer2 .ID },
542- })
542+ }, true )
543543 assert .NoError (t , err )
544544
545545 select {
@@ -608,7 +608,7 @@ func TestGroupAccountPeersUpdate(t *testing.T) {
608608 ID : "groupC" ,
609609 Name : "GroupC" ,
610610 Peers : []string {peer1 .ID , peer3 .ID },
611- })
611+ }, true )
612612 assert .NoError (t , err )
613613
614614 select {
@@ -649,7 +649,7 @@ func TestGroupAccountPeersUpdate(t *testing.T) {
649649 ID : "groupA" ,
650650 Name : "GroupA" ,
651651 Peers : []string {peer1 .ID , peer2 .ID , peer3 .ID },
652- })
652+ }, true )
653653 assert .NoError (t , err )
654654
655655 select {
@@ -676,7 +676,7 @@ func TestGroupAccountPeersUpdate(t *testing.T) {
676676 ID : "groupD" ,
677677 Name : "GroupD" ,
678678 Peers : []string {peer1 .ID },
679- })
679+ }, true )
680680 assert .NoError (t , err )
681681
682682 select {
@@ -723,7 +723,7 @@ func TestGroupAccountPeersUpdate(t *testing.T) {
723723 ID : "groupE" ,
724724 Name : "GroupE" ,
725725 Peers : []string {peer2 .ID , peer3 .ID },
726- })
726+ }, true )
727727 assert .NoError (t , err )
728728
729729 select {
0 commit comments