Looking for some guidance for unit testing a module using Play cache in Scala. I have a method which queries database, gets static data and stores in Play's cache. While writing unit tests the following error shows:
Error in custom provider, java.lang.IllegalStateException: The CacheManager has been shut down. It can no longer be used.
I do not have any tear down in my scala unit tests for this error to show up. Any advice as to why this is happening would be great.
Also, any suggestions for resolving this would by an eye-opener. One possible way I could think is having an additional parameter and enable/disable the cache depending on the parameter value for test/non-test workflows. But is that the only way. Should I pass a custom implementation of my cache just for my tests?