|
|
@@ -39,8 +39,16 @@ func (_m *mockSessionRegistry) EXPECT() *mockSessionRegistry_Expecter {
|
|
|
}
|
|
|
|
|
|
// AddSession provides a mock function for the type mockSessionRegistry
|
|
|
-func (_mock *mockSessionRegistry) AddSession(ctx context.Context, screenName state.DisplayScreenName, doMultiSess bool) (*state.SessionInstance, error) {
|
|
|
- ret := _mock.Called(ctx, screenName, doMultiSess)
|
|
|
+func (_mock *mockSessionRegistry) AddSession(ctx context.Context, screenName state.DisplayScreenName, doMultiSess bool, cfg ...func(sess *state.Session)) (*state.SessionInstance, error) {
|
|
|
+ // func(sess *state.Session)
|
|
|
+ _va := make([]interface{}, len(cfg))
|
|
|
+ for _i := range cfg {
|
|
|
+ _va[_i] = cfg[_i]
|
|
|
+ }
|
|
|
+ var _ca []interface{}
|
|
|
+ _ca = append(_ca, ctx, screenName, doMultiSess)
|
|
|
+ _ca = append(_ca, _va...)
|
|
|
+ ret := _mock.Called(_ca...)
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
panic("no return value specified for AddSession")
|
|
|
@@ -48,18 +56,18 @@ func (_mock *mockSessionRegistry) AddSession(ctx context.Context, screenName sta
|
|
|
|
|
|
var r0 *state.SessionInstance
|
|
|
var r1 error
|
|
|
- if returnFunc, ok := ret.Get(0).(func(context.Context, state.DisplayScreenName, bool) (*state.SessionInstance, error)); ok {
|
|
|
- return returnFunc(ctx, screenName, doMultiSess)
|
|
|
+ if returnFunc, ok := ret.Get(0).(func(context.Context, state.DisplayScreenName, bool, ...func(sess *state.Session)) (*state.SessionInstance, error)); ok {
|
|
|
+ return returnFunc(ctx, screenName, doMultiSess, cfg...)
|
|
|
}
|
|
|
- if returnFunc, ok := ret.Get(0).(func(context.Context, state.DisplayScreenName, bool) *state.SessionInstance); ok {
|
|
|
- r0 = returnFunc(ctx, screenName, doMultiSess)
|
|
|
+ if returnFunc, ok := ret.Get(0).(func(context.Context, state.DisplayScreenName, bool, ...func(sess *state.Session)) *state.SessionInstance); ok {
|
|
|
+ r0 = returnFunc(ctx, screenName, doMultiSess, cfg...)
|
|
|
} else {
|
|
|
if ret.Get(0) != nil {
|
|
|
r0 = ret.Get(0).(*state.SessionInstance)
|
|
|
}
|
|
|
}
|
|
|
- if returnFunc, ok := ret.Get(1).(func(context.Context, state.DisplayScreenName, bool) error); ok {
|
|
|
- r1 = returnFunc(ctx, screenName, doMultiSess)
|
|
|
+ if returnFunc, ok := ret.Get(1).(func(context.Context, state.DisplayScreenName, bool, ...func(sess *state.Session)) error); ok {
|
|
|
+ r1 = returnFunc(ctx, screenName, doMultiSess, cfg...)
|
|
|
} else {
|
|
|
r1 = ret.Error(1)
|
|
|
}
|
|
|
@@ -75,11 +83,13 @@ type mockSessionRegistry_AddSession_Call struct {
|
|
|
// - ctx context.Context
|
|
|
// - screenName state.DisplayScreenName
|
|
|
// - doMultiSess bool
|
|
|
-func (_e *mockSessionRegistry_Expecter) AddSession(ctx interface{}, screenName interface{}, doMultiSess interface{}) *mockSessionRegistry_AddSession_Call {
|
|
|
- return &mockSessionRegistry_AddSession_Call{Call: _e.mock.On("AddSession", ctx, screenName, doMultiSess)}
|
|
|
+// - cfg ...func(sess *state.Session)
|
|
|
+func (_e *mockSessionRegistry_Expecter) AddSession(ctx interface{}, screenName interface{}, doMultiSess interface{}, cfg ...interface{}) *mockSessionRegistry_AddSession_Call {
|
|
|
+ return &mockSessionRegistry_AddSession_Call{Call: _e.mock.On("AddSession",
|
|
|
+ append([]interface{}{ctx, screenName, doMultiSess}, cfg...)...)}
|
|
|
}
|
|
|
|
|
|
-func (_c *mockSessionRegistry_AddSession_Call) Run(run func(ctx context.Context, screenName state.DisplayScreenName, doMultiSess bool)) *mockSessionRegistry_AddSession_Call {
|
|
|
+func (_c *mockSessionRegistry_AddSession_Call) Run(run func(ctx context.Context, screenName state.DisplayScreenName, doMultiSess bool, cfg ...func(sess *state.Session))) *mockSessionRegistry_AddSession_Call {
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
var arg0 context.Context
|
|
|
if args[0] != nil {
|
|
|
@@ -93,10 +103,19 @@ func (_c *mockSessionRegistry_AddSession_Call) Run(run func(ctx context.Context,
|
|
|
if args[2] != nil {
|
|
|
arg2 = args[2].(bool)
|
|
|
}
|
|
|
+ var arg3 []func(sess *state.Session)
|
|
|
+ variadicArgs := make([]func(sess *state.Session), len(args)-3)
|
|
|
+ for i, a := range args[3:] {
|
|
|
+ if a != nil {
|
|
|
+ variadicArgs[i] = a.(func(sess *state.Session))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ arg3 = variadicArgs
|
|
|
run(
|
|
|
arg0,
|
|
|
arg1,
|
|
|
arg2,
|
|
|
+ arg3...,
|
|
|
)
|
|
|
})
|
|
|
return _c
|
|
|
@@ -107,14 +126,14 @@ func (_c *mockSessionRegistry_AddSession_Call) Return(sessionInstance *state.Ses
|
|
|
return _c
|
|
|
}
|
|
|
|
|
|
-func (_c *mockSessionRegistry_AddSession_Call) RunAndReturn(run func(ctx context.Context, screenName state.DisplayScreenName, doMultiSess bool) (*state.SessionInstance, error)) *mockSessionRegistry_AddSession_Call {
|
|
|
+func (_c *mockSessionRegistry_AddSession_Call) RunAndReturn(run func(ctx context.Context, screenName state.DisplayScreenName, doMultiSess bool, cfg ...func(sess *state.Session)) (*state.SessionInstance, error)) *mockSessionRegistry_AddSession_Call {
|
|
|
_c.Call.Return(run)
|
|
|
return _c
|
|
|
}
|
|
|
|
|
|
// RemoveSession provides a mock function for the type mockSessionRegistry
|
|
|
-func (_mock *mockSessionRegistry) RemoveSession(instance *state.SessionInstance) {
|
|
|
- _mock.Called(instance)
|
|
|
+func (_mock *mockSessionRegistry) RemoveSession(session *state.Session) {
|
|
|
+ _mock.Called(session)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -124,16 +143,16 @@ type mockSessionRegistry_RemoveSession_Call struct {
|
|
|
}
|
|
|
|
|
|
// RemoveSession is a helper method to define mock.On call
|
|
|
-// - instance *state.SessionInstance
|
|
|
-func (_e *mockSessionRegistry_Expecter) RemoveSession(instance interface{}) *mockSessionRegistry_RemoveSession_Call {
|
|
|
- return &mockSessionRegistry_RemoveSession_Call{Call: _e.mock.On("RemoveSession", instance)}
|
|
|
+// - session *state.Session
|
|
|
+func (_e *mockSessionRegistry_Expecter) RemoveSession(session interface{}) *mockSessionRegistry_RemoveSession_Call {
|
|
|
+ return &mockSessionRegistry_RemoveSession_Call{Call: _e.mock.On("RemoveSession", session)}
|
|
|
}
|
|
|
|
|
|
-func (_c *mockSessionRegistry_RemoveSession_Call) Run(run func(instance *state.SessionInstance)) *mockSessionRegistry_RemoveSession_Call {
|
|
|
+func (_c *mockSessionRegistry_RemoveSession_Call) Run(run func(session *state.Session)) *mockSessionRegistry_RemoveSession_Call {
|
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
|
- var arg0 *state.SessionInstance
|
|
|
+ var arg0 *state.Session
|
|
|
if args[0] != nil {
|
|
|
- arg0 = args[0].(*state.SessionInstance)
|
|
|
+ arg0 = args[0].(*state.Session)
|
|
|
}
|
|
|
run(
|
|
|
arg0,
|
|
|
@@ -147,7 +166,7 @@ func (_c *mockSessionRegistry_RemoveSession_Call) Return() *mockSessionRegistry_
|
|
|
return _c
|
|
|
}
|
|
|
|
|
|
-func (_c *mockSessionRegistry_RemoveSession_Call) RunAndReturn(run func(instance *state.SessionInstance)) *mockSessionRegistry_RemoveSession_Call {
|
|
|
+func (_c *mockSessionRegistry_RemoveSession_Call) RunAndReturn(run func(session *state.Session)) *mockSessionRegistry_RemoveSession_Call {
|
|
|
_c.Run(run)
|
|
|
return _c
|
|
|
}
|