Closed Litemn closed 6 years ago
What's your use case? Why would you want to share singleton instances across tests?
At least connection pools to DB or some shared state (I know that shared states is bad idea, but sometimes it very helpful)
Ideally you would fake out the DB connection so it isn't terribly expensive, but I can see some value in a feature like this.
I don't think it should be enabled by default, but adding some annotation that lets users opt into shared injectors would be reasonable
I add @SharedInjectors annotation for cached inhectors enabled
Looks good, thanks for bearing with me!
In original implementantion for each test guice create new injector and if we bind somting in scope SINGLETON - that not work as expected.
In this pr I provide basic implementation of cache for injectors with same modules - can you provide some feedback? @JeffreyFalgout