|
|
@@ -371,12 +371,17 @@ func TestOscarServer_RouteConnection_BOS(t *testing.T) {
|
|
|
|
|
|
authService := newMockAuthService(t)
|
|
|
authService.EXPECT().
|
|
|
- RegisterBOSSession(mock.Anything, state.ServerCookie{Service: wire.BOS}).
|
|
|
+ RegisterBOSSession(mock.Anything, state.ServerCookie{Service: wire.BOS}, mock.Anything).
|
|
|
+ Run(func(ctx context.Context, cookie state.ServerCookie, conf func(*state.Session)) {
|
|
|
+ if conf != nil {
|
|
|
+ conf(instance.Session())
|
|
|
+ }
|
|
|
+ }).
|
|
|
Return(instance, nil)
|
|
|
wg.Add(1)
|
|
|
authService.EXPECT().
|
|
|
- Signout(mock.Anything, instance).
|
|
|
- Run(func(ctx context.Context, s *state.SessionInstance) {
|
|
|
+ Signout(mock.Anything, instance.Session()).
|
|
|
+ Run(func(ctx context.Context, s *state.Session) {
|
|
|
defer wg.Done()
|
|
|
})
|
|
|
|
|
|
@@ -495,7 +500,7 @@ func TestOscarServer_RouteConnection_BOS_MultiSessionSignoff(t *testing.T) {
|
|
|
|
|
|
authService := newMockAuthService(t)
|
|
|
authService.EXPECT().
|
|
|
- RegisterBOSSession(mock.Anything, state.ServerCookie{Service: wire.BOS}).
|
|
|
+ RegisterBOSSession(mock.Anything, state.ServerCookie{Service: wire.BOS}, mock.Anything).
|
|
|
Return(instance, nil)
|
|
|
|
|
|
authService.EXPECT().
|
|
|
@@ -598,7 +603,7 @@ func TestOscarServer_RouteConnection_BOS_MaxConcurrentSessionsReached(t *testing
|
|
|
|
|
|
authService := newMockAuthService(t)
|
|
|
authService.EXPECT().
|
|
|
- RegisterBOSSession(mock.Anything, state.ServerCookie{Service: wire.BOS}).
|
|
|
+ RegisterBOSSession(mock.Anything, state.ServerCookie{Service: wire.BOS}, mock.Anything).
|
|
|
Return(nil, state.ErrMaxConcurrentSessionsReached)
|
|
|
|
|
|
authService.EXPECT().
|
|
|
@@ -913,14 +918,19 @@ func Test_oscarServer_receiveSessMessages_BOS_integration(t *testing.T) {
|
|
|
CrackCookie(mock.Anything).
|
|
|
Return(state.ServerCookie{Service: wire.BOS}, nil)
|
|
|
authService.EXPECT().
|
|
|
- RegisterBOSSession(mock.Anything, state.ServerCookie{Service: wire.BOS}).
|
|
|
+ RegisterBOSSession(mock.Anything, state.ServerCookie{Service: wire.BOS}, mock.Anything).
|
|
|
+ Run(func(ctx context.Context, cookie state.ServerCookie, conf func(*state.Session)) {
|
|
|
+ if conf != nil {
|
|
|
+ conf(instance.Session())
|
|
|
+ }
|
|
|
+ }).
|
|
|
Return(instance, nil)
|
|
|
|
|
|
var signoutWG sync.WaitGroup
|
|
|
signoutWG.Add(1)
|
|
|
authService.EXPECT().
|
|
|
- Signout(mock.Anything, instance).
|
|
|
- Run(func(ctx context.Context, s *state.SessionInstance) { signoutWG.Done() })
|
|
|
+ Signout(mock.Anything, instance.Session()).
|
|
|
+ Run(func(ctx context.Context, s *state.Session) { signoutWG.Done() })
|
|
|
|
|
|
onlineNotifier := newMockOnlineNotifier(t)
|
|
|
onlineNotifier.EXPECT().
|