[GODRIVER-1899] Remove unexported method from Session interface Created: 25/Feb/21  Updated: 27/Oct/23  Resolved: 25/Mar/21

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Daniel Montoya Assignee: Benji Rewis (Inactive)
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible

 Description   

This makes mocking the interface tricky, since any imported mock will miss method session.



 Comments   
Comment by Backlog - Core Eng Program Management Team [ 25/Mar/21 ]

There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information.

Comment by Benji Rewis (Inactive) [ 10/Mar/21 ]

While we appreciate that mocking the Session interface might be of use in unit testing, we’d rather not allow users to do this.

Mocking a Session for testing purposes can leave you vulnerable to changes in Session behavior. We may put out a patch that changes Session behavior and puts a user’s mock implementation out of line with our own.

If testing the behavior of your application with Sessions is a must, we recommend that you use an integration test. That test could mimic the behavior of one of your users interacting with a Session.

Comment by Daniel Montoya [ 10/Mar/21 ]

I just want to mock the Session interface, so I can run some unit tests without connecting to the server. I would like to assert I'm calling the right methods on each case.

Comment by Benji Rewis (Inactive) [ 02/Mar/21 ]

Hello dsmontoyam@gmail.com! Thanks again for your request.

The unexported session method in the Session interface was intentional in the original design. We had not expected users to implement the interface manually.

Could you elaborate on your need to mock the Session interface? Perhaps there is a better solution we could recommend.

Comment by Kevin Albertson [ 25/Feb/21 ]

Hi dsmontoyam@gmail.com, thank you for filing this request. We will look into this soon.

And no worries, major is the default priority for new tickets.

Comment by Daniel Montoya [ 25/Feb/21 ]

I'm so sorry for the priority major. It seems I can't change it once created.

Generated at Thu Feb 08 08:37:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.