package eu.cloudopting.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.support.NoOpCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import javax.annotation.PreDestroy;

@Configuration
@EnableCaching
@AutoConfigureAfter(value = {DatabaseConfiguration.class})
@Profile("!" + Constants.SPRING_PROFILE_FAST)
public class CacheConfiguration {

    private final Logger log = LoggerFactory.getLogger(CacheConfiguration.class);

    private CacheManager cacheManager;

    @PreDestroy
    public void destroy() {
        log.info("Closing Cache Manager");
    }

    @Bean
    public CacheManager cacheManager() {
        log.debug("No cache");
        cacheManager = new NoOpCacheManager();
        return cacheManager;
    }
}

@@ -291,20 +291,86 @@
 che.
-support.NoOp
+concurrent.ConcurrentMapCache;%0Aimport org.springframework.cache.support.Simple
 Cach
@@ -548,16 +548,42 @@
 ofile;%0A%0A
+import java.util.Arrays;%0A%0A
 import j
@@ -868,48 +868,8 @@
 );%0A%0A
-    private CacheManager cacheManager;%0A%0A
     
@@ -1017,43 +1017,74 @@
     
-    log.debug(%22No cache%22
+%09SimpleCacheManager cacheManager = new SimpleCacheManager(
 );%0A    
- 
-   
+%09
 cach
@@ -1095,32 +1095,67 @@
 ager
- = new NoOpCacheManager(
+.setCaches(Arrays.asList(new ConcurrentMapCache(%22default%22))
 );%0A 

Enable Spring cache