Removing Spring.Cache
-
16-09-2019 - |
Question
I am trying to clear the cache for my integration testing. I could find "InvalidateCache" attribute in Spring documentation, but i do not want to touch the real function and change the attribute. I think I can't use .Net's HttpContext.Cache.Remove since my integration test application is not web application. Anyone knows how to do it?
Solution
I think I can't use .Net's HttpContext.Cache.Remove since my integration test application is not web application.
Why don't you create an abstraction on it? An ICache interface with a clear method for instance. Then you can use an in memory cache for your integration testing.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow