title: How to turn off ehcache for test purposes
body: <p>I have an implementation of ehcache which doesn't use any config from an xml but as shown below:</p>
  
  <pre><code>private Ehcache cache;
  
  constructor {
    cache = CacheManager.getInstance().addCacheIfAbsent("nameOfCache");
    CacheConfiguration config = cache.getCacheConfiguration();
    config.eternal("false")
    config.setTimeToLiveSeconds(&lt;someTime&gt;);
  }
  </code></pre>
  
  <p>Now, I have used guava cache before and I know that by setting the eviction time to <code>0</code> in a guava cache, it turns off the caching. But by reading the documentation about ehcache, I understand its not the same case. Is there any other way to turn the cache off?</p>