@@ -1432,17 +1432,19 @@ func TestSessionWrapper_RenewPeriodic(t *testing.T) {
14321432 sessionID := "session_id"
14331433 writeOptions := & api.WriteOptions {}
14341434 doneCh := make (chan struct {})
1435+ // Convert to receive-only channel
1436+ var receiveOnlyDoneCh <- chan struct {} = doneCh
14351437
14361438 expectedErr := errors .New ("renew error" )
14371439
1438- mockSession .On ("RenewPeriodic" , initialTTL , sessionID , writeOptions , doneCh ).Return (expectedErr )
1440+ mockSession .On ("RenewPeriodic" , initialTTL , sessionID , writeOptions , receiveOnlyDoneCh ).Return (expectedErr )
14391441
14401442 // Act
1441- err := sessionWrapper .RenewPeriodic (initialTTL , sessionID , writeOptions , doneCh )
1443+ err := sessionWrapper .RenewPeriodic (initialTTL , sessionID , writeOptions , receiveOnlyDoneCh )
14421444
14431445 // Assert
14441446 assert .Equal (t , expectedErr , err )
1445- mockSession .AssertCalled (t , "RenewPeriodic" , initialTTL , sessionID , writeOptions , doneCh )
1447+ mockSession .AssertCalled (t , "RenewPeriodic" , initialTTL , sessionID , writeOptions , receiveOnlyDoneCh )
14461448}
14471449
14481450func TestKVWrapper_Get (t * testing.T ) {
@@ -1616,8 +1618,8 @@ func (m *MockSession) Info(sessionID string, q *api.QueryOptions) (*api.SessionE
16161618 return args .Get (0 ).(* api.SessionEntry ), args .Get (1 ).(* api.QueryMeta ), args .Error (2 )
16171619}
16181620
1619- func (m * MockSession ) RenewPeriodic (initialTTL string , sessionID string , q * api.WriteOptions , doneCh <- chan struct {}) error {
1620- args := m .Called (initialTTL , sessionID , q , doneCh )
1621+ func (m * MockSession ) RenewPeriodic (initialTTL string , id string , q * api.WriteOptions , doneCh <- chan struct {}) error {
1622+ args := m .Called (initialTTL , id , q , doneCh )
16211623 return args .Error (0 )
16221624}
16231625
0 commit comments