Creation of DataNodeBuilder with module name prefix is very slow
[cps.git] / cps-ri / src / test / groovy / org / onap / cps / spi / impl / CpsPersistenceSpecBase.groovy
index d6f10d8..1fbff65 100644 (file)
 package org.onap.cps.spi.impl
 
 import com.fasterxml.jackson.databind.ObjectMapper
+import com.hazelcast.config.Config
+import com.hazelcast.instance.impl.HazelcastInstanceFactory
+import com.hazelcast.map.IMap
 import org.onap.cps.DatabaseTestContainer
+import org.onap.cps.spi.cache.AnchorDataCacheEntry
 import org.onap.cps.spi.repository.AnchorRepository
 import org.onap.cps.spi.repository.DataspaceRepository
 import org.onap.cps.spi.repository.FragmentRepository
@@ -58,6 +62,12 @@ class CpsPersistenceSpecBase extends Specification {
     @SpringBean
     JsonObjectMapper jsonObjectMapper = new JsonObjectMapper(new ObjectMapper())
 
+    // Instantiate Hazelcast with different name for testing purposes!
+    @SpringBean
+    IMap<String, AnchorDataCacheEntry> anchorDataCache = HazelcastInstanceFactory
+        .getOrCreateHazelcastInstance(new Config('hazelcastTestInstance'))
+        .getMap('testAnchorDataCacheMap')
+
     static final String CLEAR_DATA = '/data/clear-all.sql'
 
     static final String DATASPACE_NAME = 'DATASPACE-001'