Added CSIT for Macroflow with HEAT
[integration/csit.git] / plans / so / integration-etsi-testing / so-simulators / multicloud-simulator / src / main / java / org / onap / so / multicloudsimulator / configuration / ApplicationConfiguration.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * Copyright 2021 Huawei Technologies Co., Ltd.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ============LICENSE_END=========================================================
17  */
18 package org.onap.so.multicloudsimulator.configuration;
19
20 import static org.onap.so.multicloudsimulator.utils.Constants.MULTICLOUD_CACHE;
21 import java.util.Arrays;
22 import org.springframework.cache.Cache;
23 import org.springframework.cache.CacheManager;
24 import org.springframework.cache.concurrent.ConcurrentMapCache;
25 import org.springframework.cache.support.SimpleCacheManager;
26 import org.springframework.context.annotation.Bean;
27 import org.springframework.context.annotation.Configuration;
28
29 @Configuration
30 public class ApplicationConfiguration {
31
32     @Bean
33     public CacheManager cacheManager() {
34         final SimpleCacheManager manager = new SimpleCacheManager();
35         manager.setCaches(Arrays.asList(getCache(MULTICLOUD_CACHE)));
36         return manager;
37     }
38
39     private Cache getCache(final String name) {
40         return new ConcurrentMapCache(name);
41     }
42 }