You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project, I created a trait and implemented it for the Session struct that added some basic functionality customized to my use case (in this case, validating a user id and expiration time against the SessionStore, for authentication purposes).
I wanted to package this trait as a library to use in multiple microservices, and build unit tests for it. But I am getting stuck in that I cannot see a way to create an instance of Session for my tests. There is no constructor, the Session{...} syntax does not work due to private fields, and I can't seem to get a way to create one via an HttpRequest (which also does not appear to have a constructor) within a unit test.
I'm going to propose a PR to do this shortly, but I wanted to add an issue explaining what I was doing.
The text was updated successfully, but these errors were encountered:
In my project, I created a trait and implemented it for the Session struct that added some basic functionality customized to my use case (in this case, validating a user id and expiration time against the SessionStore, for authentication purposes).
I wanted to package this trait as a library to use in multiple microservices, and build unit tests for it. But I am getting stuck in that I cannot see a way to create an instance of Session for my tests. There is no constructor, the
Session{...}
syntax does not work due to private fields, and I can't seem to get a way to create one via an HttpRequest (which also does not appear to have a constructor) within a unit test.I'm going to propose a PR to do this shortly, but I wanted to add an issue explaining what I was doing.
The text was updated successfully, but these errors were encountered: