Empty session implementation

32 views
Skip to first unread message

Werick Vieira dos Santos

unread,
Nov 27, 2019, 9:14:34 AM11/27/19
to mongodb-go-driver
Hello, I was looking up to Session interface and there is a private method session in this interface. But, this method session has an empty implementation. By it to be private, I'm having some problems in create a mock file of this interface. I'd like to know if this session method have some utility. Thanks!



Divjot Arora

unread,
Dec 2, 2019, 10:23:16 AM12/2/19
to mongodb-go-driver
Hi,

The Session interface represents a MongoDB logical session. Can you explain your use case for mocking this?

Werick Vieira dos Santos

unread,
Dec 4, 2019, 3:30:26 PM12/4/19
to mongodb-go-driver
Hi, I used the method EndSession to closed my sessions.  When write my tests, I make a mock this interface. I'm using different packages for mocking files, the other package don't visibility session method of Session interface.

Divjot Arora

unread,
Dec 20, 2019, 1:06:40 PM12/20/19
to mongodb-go-driver
Sorry for the delayed response. We are considering small changes to the driver's sessions API that will hopefully make sessions and transactions easier to use. I will bring up the concern of mocking the Session type during this discussion.

-- Divjot
Reply all
Reply to author
Forward
0 new messages